# ES7(2016)

# 【1】Array.prototype.includes

includes() 函数用来判断一个数组是否包含一个指定的值,根据情况,如果包含则返回true,否则返回false。includes 函数与 indexOf 函数很相似

list.includes(x)
// 等价于
list.indexOf(x) >= 0
let arr = ["vue", "react", "angular"];

console.log(arr.includes("vue"));	// true

# 【2】指数操作符

在ES7中引入了指数运算符****具有与Math.pow(..)等效的计算结果。

a ** b,它与 Math.pow(a, b)相同。

let num = 2 ** 10;

console.log(num);	// 1024
console.log(Math.pow(2, 10));	// 1024