ES7
数组方法 includes
includes 检测数组中是否包含某个元素,返回布尔类型
indexOf方法,存在返回索引,不存在返回-1
let arr = [1, 11, 22, 33, 44, 55, 66];
console.log(arr.indexOf(33)); // 3
console.log(arr.indexOf(333)); // -1
includes
let arr = [1, 11, 22, 33, 44, 55, 66];
console.log(arr.includes(33)); // true
console.log(arr.includes(333)); // false
** 幂运算
console.log(2 ** 10); // 1024
与 Math.pow(2, 10) 效果一样
console.log(Math.pow(2, 10)); // 1024