snippet

Get index of value in array on Javascript

const myElements = ["zero", "one", "two", "three"];
list.indexOf("one"); // 1
list.indexOf("zero"); // 0
Related snippets