1 let a = 'abcd' //let a = ['a','b','c','d'] 亦可 2 console.log(a.includes('a')) //true 3 console.log(a.indexOf('a')) //0 4 includes:es6中新增加的方法,返回值为布尔值 5 indexOf:返回值为所在的索引