How to Check if a JavaScript array contains a string
Learn how to use JavaScript array contains methods and techniques to check for different types of elements in arrays.
let colors = ["Red", "Green", "Blue"];
console.log(colors.indexOf("Green")); // Output: 1
console.log(colors.indexOf("White")); // Output: -1