<script>
//includes
let arr1 = ["天津","上海","北京","深圳"]
console.log(arr1.includes('河北')) //false
console.log(arr1.includes('天津')) //true
</script>
includes是ES7中的新特性
includes方法用来监测数组中是否包含某个元素,返回布尔类型的值
<script>
//includes
let arr1 = ["天津","上海","北京","深圳"]
console.log(arr1.includes('河北')) //false
console.log(arr1.includes('天津')) //true
</script>
includes是ES7中的新特性
includes方法用来监测数组中是否包含某个元素,返回布尔类型的值