IndexOf() method returns the position of the first occurrence of a value in a string.
Example:
let str = "I love the taste of sugar in the morning"
let noun = str.indexOf("sugar")
console.log(noun);
// Output of 20
IndexOf() method returns the position of the first occurrence of a value in a string.
Example:
let str = "I love the taste of sugar in the morning"
let noun = str.indexOf("sugar")
console.log(noun);
// Output of 20
For further actions, you may consider blocking this person and/or reporting abuse
Mike Young -
Kerry Owston -
Daniel Sogl -
Karl Esi -
Oldest comments (0)