Code to go logo
Created using Figma
Use Cases
Contribute
How to find index of element in array in JavaScript
Arrays
By Jad Joubran ·
Last updated Mar 29, 2018
const colors = ["red", "green", "blue"]; colors.indexOf("green");
1
Mar 29, 2018
1
Jad Joubran
See answer
1
Jad Joubran
Array.indexOf
on MDN
Learn JavaScript step by step