js get index of list code example
Example 1: js find index in list
let myList = ['foo', 'bar', 'qux'];
myList.indexOf('bar'); // 1
Example 2: js get index of item in array
array.indexOf("item");
Example 3: indexof js mdn
array.indexOf(searchElement, [initialPoint = 0])
// the indexOf() always returns the first index that the element can be found, else it returns -1