Home / Javascript Tips Generated By ChatGPT / Finding the Index of an Element in an Array in Javascript Use .indexOf() to find the position of an item in an array. Source Code let fruits = ["Apple", "Banana", "Orange"]; let bananaIndex = fruits.indexOf("Banana"); console.log(bananaIndex); // 1