WeCodeAcademy
❮ substring()includes() ❯

String indexOf()

The position of the first match, or -1.

Group: String

Syntax

string.indexOf(text)

Example

Examplejavascript
Open in editor »

← All of JavaScript Reference