9.js-版本ES7、8、9、10、11、12

307 阅读1分钟

ES2009(ES5) 2009年发布es5

ES2015(ES6) 2015年发布的es6

ES2016(ES7)新特性

Array.prototype.includes

使用 a ** b 简化 Math.pow(a, b)。求冥运算 2**4 = 16

ES2017(ES8)新特性

# Object.values() / Object.entries()

async/await 异步函数

ES2018(ES9)新特性

ES2019(ES10)带来的9个新特性

ES2020(ES11)带来的新特性

BigInt

Promise.allSettled

ES2021(ES12)新特性解读

Promise.any

Numeric literal separator(数字分隔符)

为了提高大数字的可读性,现在可以用 _ 作为数字的分隔符:

const num = 1_000_000_000 // 1000000000

类似于我们经常看到的 1,000,000,000,当然分割线的形式没强制要求隔3位才分割。