how to get the index in a list in javascript 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");
let myList = ['foo', 'bar', 'qux'];
myList.indexOf('bar'); // 1
array.indexOf("item");