Skip to content

indexOf

indexOf(target, source)

Returns the index of the first occurrence of source string in target string, or -1 if not found.

ts
indexOf("hello world", "world"); // 6
ts
pipe("hello world", indexOf("world")); // 6