Get a list item by index in Javascript
Introduction to the JavaScript array indexOf() method
To find the position of an element in an array, you use the indexOf() method. This method returns the index of the first occurrence the element that you want to find, or -1 if the element is not found.
Array.indexOf(searchElement, fromIndex)
js find index in list
let myList = ['foo', 'bar', 'qux'];
myList.indexOf('bar'); // 1