includes判断字符串是否包含某个xxx
这边说一个比较好用的方法
includes使用方法特别简单
判断字符串
var a = 'aabbcc'; console.log(a.includes('aa')); //true console.log(a.includes('dd')); //false
数组判断
var arr =['哈哈','你好']; console.log(arr.includes('坏')); //false console.log(arr.includes('你好')); //true