Answers for "how to find the index of a value in an array in javascript"

16

how to find the index of a value in an array in javascript

var list = ["apple","banana","orange"]

var index_of_apple = list.indexOf("apple") // 0
Posted by: Guest on February-01-2020
3

js find index in list

let myList = ['foo', 'bar', 'qux'];

myList.indexOf('bar');	// 1
Posted by: Guest on July-18-2020

Code answers related to "how to find the index of a value in an array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language