跳转到内容

各 ECMA 版本更新内容

版本 (ES)发布时间主要更新内容
ES5 (ECMAScript 5)2009年引入严格模式("use strict")、JSON 支持、数组方法(forEachmapfilter 等)、对象方法(keysdefineProperty 等)
ES6 (ES2015)2015年6月块级作用域(letconst)、箭头函数、类(Class)、模板字符串、解构赋值、Promise、模块(importexport)、Symbol 类型等
ES20162016年6月数组方法 includes()、指数运算符(**
ES20172017年6月异步函数(asyncawait)、字符串填充方法(padStartpadEnd)、对象方法(entriesvalues)、函数参数尾逗号
ES20182018年6月异步迭代(for-await-of)、Promise.finally()、对象展开运算符(...)、正则表达式改进(命名捕获组等)
ES20192019年6月数组方法(flat()flatMap())、Object.fromEntries()、字符串方法(trimStart()trimEnd()
ES20202020年6月BigInt 类型、动态 import、空值合并运算符(??)、可选链操作符(?.)、Promise.allSettled()globalThis
ES20212021年6月字符串方法 replaceAll()Promise.any()、数值分隔符(1_000)、逻辑赋值运算符(&&=||=??=
ES20222022年6月类静态块(static {})、私有类字段(#field)、正则表达式匹配索引(d标志)、顶层 await
ES20232023年6月数组方法(findLast()findLastIndex())、Hashbang 语法支持、Symbol 作为 WeakMap
ES2024 (预计)2024年6月新增集合方法(Set.prototype.unionintersection等)、正则表达式重复命名捕获组
ES2025 (提案)2025年3月Temporal 日期时间 API、装饰器(Decorators)、JSON模块、Promise.try()、集合方法完善