Search for elements:
let colors = ["red", "green", "blue"]
console.log(colors.indexOf("green")) // 1
console.log(colors.indexOf("yellow")) // -1 (not found)
console.log(colors.includes("red")) // true
console.log(colors.includes("yellow")) // false
Use indexOf() when you need the position. Use includes() when you just need to check existence.