Answers for "get item position in array javascript"

7

js get index of item in array

array.indexOf("item");
Posted by: Guest on May-13-2020
0

get the location of an item in an array

console.log(scores.indexOf(10)); // 0
console.log(scores.indexOf(30)); // 2
console.log(scores.indexOf(50)); // -1
console.log(scores.indexOf(20)); // 1
Posted by: Guest on August-06-2020

Code answers related to "get item position in array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language