How to find index of element in array in JavaScript

Arrays
Last updated Mar 29, 2018
const colors = ["red", "green", "blue"];
colors.indexOf("green");
1