第一个是includes判断数组中的元素是否存在
let arr = ['hello', 'world'] console.log(arr.includes('hello')) // true console.log(arr.includes('helle')) // false第二个是指数运算。ES7进行了简写
ES5中的做法
Math.pow(2, 2) // 4ES7中的做法
2 ** 2 // 4
第一个是includes判断数组中的元素是否存在
let arr = ['hello', 'world'] console.log(arr.includes('hello')) // true console.log(arr.includes('helle')) // false第二个是指数运算。ES7进行了简写
ES5中的做法
Math.pow(2, 2) // 4ES7中的做法
2 ** 2 // 4
评论一下?