美文网首页
es7新增特性

es7新增特性

作者: 谭鱼鱼 | 来源:发表于2017-12-04 11:46 被阅读0次

自es7发布以来,有两个新特性尤为突出:

1.数组中查找元素

语法:array.includes(value,index),其中value为查找的值,index表示从此下标开始查找

例子:var arr=['a','b','c'];

arr.includes('a')------------------返回true

arr.includes('a',1)----------------返回false

arr.includes('b',1)-----------------返回true

2.求幂运算

3**2------------------9

2**10-----------------1024

相关文章

  • es7新增特性

    自es7发布以来,有两个新特性尤为突出: 1.数组中查找元素 语法:array.includes(value,in...

  • es6-字符串扩展

    字符串新增特性 Unicode表示法 遍历接口 模板字符串 新增方法 babel-polifill 兼容 es7 ...

  • ES7、ES6、ES5实现求数组的并集

    1、ES7实现方式 ES7中新增一个Array.prototype.includes():includes() 方...

  • ES7及ES8新特性

    ES7新特性 (ECMAScript2016 新特性) 一、Array 1、Array.prototype.inc...

  • Math方法和es新特性

    es6常用 es7新特性 es8新特性 es9新特性 es10新特性

  • ES7,ES8简单介绍

    ES7新特性: Array.prototype.includes Array.prototype.includes...

  • ES7特性

    1、Array.prototype.includes(value : any) : boolean 常见问题 为什...

  • ES7特性

    ES7 没有this 箭头函数对比ES6 ES7 Spread & Rest Operator spread .....

  • ECMAScript7,8,9

    ES7特性2个 Array.prototype.includes() 指数操作符 ES8特性7个 异步 Objec...

  • ES6~ES7/ES8发生的变化

    ES7新特性 ES7在ES6的基础上添加了三项内容:求幂运算符()、Array.prototype.include...

网友评论

      本文标题:es7新增特性

      本文链接:https://www.haomeiwen.com/subject/wdhoyxtx.html