-
作用域
-
sum = (a, b) => a + b
nums.forEach( v => { console.log(v) })
- 词法 this
-
参数处理
-
原有字面量加强
- 更安全的二进制字面量(0b1111101)
- 更安全的八进制字面量(0o767)
- 字符串支持 Unicode
- 正则表达式字面量添加 Unicode 支持(u 标记)
- 正则表达式添加 y 标记,支持粘滞匹配
-
- 属性定义支持短语法
obj = { x, y }
- 属性名支持表达式
obj = {["baz" + quux() ]: 42}
- 添加
__proto__
属性,但不建议使用
- 属性定义支持短语法
-
- 数组匹配
[ b, a ] = [ a, b ]
- 对象匹配
let { a, b, c } = objABC
- 参数匹配
function g ({ name: n, val: v }) {}
- 数组匹配
-
模块
-
迭代
-
元编程
-
新增数据类型
-
原有内置对象 API 增强
- Object.assign
- Array.from
- Array.of
- Array.prototype.fill
- Array.prototype.find
- Array.prototype.findIndex
- Array.prototype.copyWithin
- Array.prototype.entries
- Array.prototype.keys
- Array.prototype.values
- String.prototype.includes
- String.prototype.repeat
- String.prototype.startsWith
- String.prototype.endsWith
- Number.EPSILON
- Number.isInteger
- Number.isSafeInteger
- Number.isFinite
- Number.isNaN(‘NaN’) // false
- Math.acosh
- Math.hypot
- Math.imul
- Math.sign
- Math.trunc
-
尾递归优化
网友评论