判断一个数组是否包含一个指定的值 includes-ES6

var array1 = [1, 2, 3];

console.log(array1.includes(2));  // true
console.log(array1.includes(2, 5));  // false


array1.includes(value, index);

// value 要搜索的值

// index 从什么位置开始搜索

 img

posted on 2019-03-26 11:37  完美前端  阅读(420)  评论(0)    收藏  举报

导航