0
Q:

indexof js mdn

"Blue Whale".indexOf("Blue");     // retorna  0
"Blue Whale".indexOf("Blute");    // retorna -1
"Blue Whale".indexOf("Whale", 0); // retorna  5
"Blue Whale".indexOf("Whale", 5); // retorna  5
"Blue Whale".indexOf("Whale", 7); // retorna -1
"Blue Whale".indexOf("");         // retorna  0
"Blue Whale".indexOf("", 9);      // retorna  9
"Blue Whale".indexOf("", 10);     // retorna 10
"Blue Whale".indexOf("", 11);     // retorna 10
1
array.indexOf(searchElement, [initialPoint = 0])

// the indexOf() always returns the first index that the element can be found, else it returns -1
0

New to Communities?

Join the community