Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js array get index

var fruits = ["Banana", "Orange", "Apple", "Mango"];
return fruits.indexOf("Apple"); // Returns 2
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #array #index
ADD COMMENT
Topic
Name
2+6 =