1.根据数组的indexOf方法来判断,如果存在,则返回该元素的索引值,不存在返回-1
var arr=["aa", "bb", "cc", "dd"];
console.log(arr.indexOf ('aa'));//0
console.log(arr.indexOf ('dd'));//3
console.log(arr.indexOf ('ee'));//-1
2、根据数组的includes方法来判断,如果存在,则返回true,不存在则返回false
let arr = ['aa','bb'];
arr.includes('aa') // true
arr.includes('cc') //false