Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript array findindex

// find index of array item; test values using a function
const arr = ['A','B','C'];
const index = arr.findIndex((item) => item === 'B');	// index == 1
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #array #findindex
ADD COMMENT
Topic
Name
8+7 =