var colors = ["red", "blue", "green"]; if(colors.indexOf("blue") !== -1){ //colors contains the string "blue" }else{ //colors does not contain the string "blue" }
var myList=["a", "b", "c"]; mylist.includes("d")//returns true or false
javascript check if a string is in an array