Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #location #item #array
ADD COMMENT
Topic
Name
3+1 =