ES6 新特性列表
ES6 新特性列表
- 点击链接,查看中文学习资料。
 
正文
作用域
箭头函数
- sum = (a, b) => a + b
 - nums.forEach( v => { console.log(v) })
 - 词法 this
 
参数处理
模板字面量
原有字面量加强
- 更安全的二进制字面量(0b1111101)
 - 更安全的八进制字面量(0o767)
 - 字符串支持 Unicode
 - 正则表达式字面量添加
 
对象属性加强
- 属性定义支持短语法 obj = { x, y }
 - 属性名支持表达式 obj = {[“baz” + quux() ]: 42}
 - 添加 proto 属性,但不建议使用
 
解构赋值
- 数组匹配 [ b, a ] = [ a, b ]
 - 对象匹配 let { a, b, c } = objABC
 - 参数匹配 function g ({ name: n, val: v }) {}
 
模块
类
迭代
生成器
Promise
元编程
新增数据类型
原有内置对象 API 增强
- Array.from
 - Array.of
 - Array.prototype.fill
 - Array.prototype.find
 - Array.prototype.findIndex
 - Array.prototype.copyWithin
 - Array.prototype.entries
 - Array.prototype.keys
 - String.prototype.includes
 - String.prototype.repeat
 - String.prototype.startsWith
 - Number.EPSILON
 - Number.isInteger
 - Number.isSafeInteger
 - Number.isFinite
 - >Math.acosh
 - Math.hypot
 - Math.imul
 - Math.sign
 - Math.trunc
 
尾递归优化
结束
- 后续会补充
 
【 THE END 】
------ ShenBao on May 3, 2017
    温馨提示:评论可能需要科学上网,若不能正常显示,敬请谅解!