Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Find the index of an item in the Array

fruits.push('Mango')
// ["Strawberry", "Banana", "Mango"]

let pos = fruits.indexOf('Banana')
// 1
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Find #index #item #Array
ADD COMMENT
Topic
Name
1+3 =