马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- arr.includes(3, 3); // false
- arr.includes(3, 20); // false
复制代码 1.2.2 计算出的索引小于0
假如fromIndex为负值,利用数组长度 + fromIndex计算出的索引作为新的fromIndex,假如新的fromIndex为负值,则搜索整个数组。
- arr.includes(3, -100); // true
- arr.includes(3, -1); // false
复制代码 二、Exponentiation Operator幂运算
幂运算符**,相当于Math.pow()
- 5 ** 2 // 25
- Math.pow(5, 2) // 25
复制代码 ES8
ES2017(ES8)新增了以下特性 |