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
Takuu Kaku -
Abhay Singh Kathayat -
Abhay Singh Kathayat -
Prince -
Top comments (0)