1、array.prototype.includes
判断某一项是否在数组中,直接返回boolean值
let arr = ['aaaa','bbbb','cccc','dddd'];
console.log(arr.includes('aaaa'));
比indexOf判断简单
2、** 替代 Math.pow()
//console.log(2**10)
Math.pow(2,10)
//1024
1、array.prototype.includes
判断某一项是否在数组中,直接返回boolean值
let arr = ['aaaa','bbbb','cccc','dddd'];
console.log(arr.includes('aaaa'));
比indexOf判断简单
2、** 替代 Math.pow()
//console.log(2**10)
Math.pow(2,10)
//1024
本文标题:ECMAScript7新特性
本文链接:https://www.haomeiwen.com/subject/aopmiktx.html
网友评论