为保证最佳的阅读体验,建议前往语雀体验[比心]
在语雀文档持续更新……
由于头条文章链接功能不理想,如需访问可以复制至浏览器进行访问[握手]
全网较(最(至少应该也排前几名吧[做鬼脸]))新ECMAScript特性整理
截止到目前为止,已经有这么多新特性了:ES6(2015)、ES7(2016)、ES8(2017)、ES9(2018)、ES10(2019)、ES11(2020)、ES12(2021)、ES13(2022)……
Proposal in progress
提案进行中
特性 | proposal | tc39 |
Array.fromAsync | https://github.com/tc39/proposal-array-from-async | https://tc39.es/proposal-array-from-async/ stage 3 |
Symbols as WeakMap keys | https://github.com/tc39/proposal-symbols-as-weakmap-keys | https://tc39.es/proposal-symbols-as-weakmap-keys/ stage 3 |
JSON.parse source text access | https://github.com/tc39/proposal-json-parse-with-source | https://tc39.es/proposal-json-parse-with-source/ stage 3 |
Change Array by copy | https://github.com/tc39/proposal-change-array-by-copy | https://tc39.es/proposal-change-array-by-copy/ stage 3 |
Intl Locale Info API | https://github.com/tc39/proposal-intl-locale-info | https://tc39.es/proposal-intl-locale-info/ stage 3 |
Duplicate named capturing groups | https://github.com/tc39/proposal-duplicate-named-capturing-groups | stage 3 |
String dedent | https://github.com/tc39/proposal-string-dedent | https://tc39.es/proposal-string-dedent/ stage 2 |
Import Reflection | https://github.com/tc39/proposal-import-reflection | https://tc39.es/proposal-import-reflection/ stage 2 |
Well-Formed Unicode Strings | https://github.com/tc39/proposal-is-usv-string | https://tc39.es/proposal-is-usv-string/ stage 2 |
Regular Expression Pattern Modifiers for ECMAScript | https://github.com/tc39/proposal-regexp-modifiers | https://tc39.es/proposal-regexp-modifiers/ stage 2 |
Extractors | https://github.com/tc39/proposal-extractors | stage 1 |
ECMAScript Pattern Matching | https://github.com/tc39/proposal-pattern-matching | https://tc39.es/proposal-pattern-matching/ stage 1 |
Regular Expression Atomic Operators for ECMAScript | https://github.com/tc39/proposal-regexp-atomic-operators | https://tc39.es/proposal-regexp-atomic-operators/ stage 1 |
faster-promise-adoption | https://github.com/tc39/proposal-faster-promise-adoption | https://tc39.es/proposal-faster-promise-adoption/ stage 1 |
Symbol Predicates Proposal | https://github.com/tc39/proposal-symbol-predicates | https://tc39.es/proposal-symbol-predicates/ stage 1 |
Policy Maps and Sets | https://github.com/tc39/proposal-policy-map-set | stage 1 |
Function.prototype.memo | https://github.com/tc39/proposal-function-memo | stage 1 |
Dynamic Object Restructuring | https://github.com/tc39/proposal-object-pick-or-omit | stage 1 |
ES13(2022)
特性 | MDN | proposal | tc39 |
类(class-fields) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Classes/Public_class_fields https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Classes/Private_class_fields | https://github.com/tc39/proposal-class-fields | https://tc39.es/proposal-class-fields/ |
static 静态方法 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Classes/static | https://github.com/tc39/proposal-class-static-block | https://tc39.es/proposal-class-static-block/ |
String.prototype.at() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/at | https://github.com/tc39/proposal-string-prototype-codepoints | https://tc39.es/proposal-string-prototype-codepoints/ |
Object.prototype.hasOwn() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn | https://github.com/tc39/proposal-accessible-object-hasownproperty | https://tc39.es/proposal-accessible-object-hasownproperty/ |
error.cause | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Error | https://github.com/tc39/proposal-error-cause | https://tc39.es/proposal-error-cause/ |
正则表达式捕获组(Groups and ranges) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences | https://github.com/tc39/proposal-pattern-matching | https://tc39.es/proposal-pattern-matching/ |
Array.prototype.groupToMap() | https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/groupToMap | https://github.com/tc39/proposal-array-grouping | https://tc39.es/proposal-array-grouping/ |
Array.prototype.findLastIndex/findLastIndex() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex | https://github.com/tc39/proposal-array-find-from-last | https://tc39.es/proposal-array-find-from-last/index.html |
Hashbang Grammar | https://github.com/tc39/proposal-hashbang | https://tc39.es/proposal-hashbang/out.html |
ES12(2021)
特性 | MDN | proposal | tc39 |
String.prototype.replaceAll | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll | https://github.com/tc39/proposal-string-replaceall | https://tc39.es/proposal-string-replaceall/ |
Promise.any + AggregateError | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/any | https://github.com/tc39/proposal-promise-any | https://tc39.es/proposal-promise-any/ |
WeakRef | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WeakRef | https://github.com/tc39/proposal-weakrefs | https://tc39.es/proposal-weakrefs/ |
Intl.ListFormat | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat | https://github.com/tc39/proposal-intl-list-format | https://tc39.es/proposal-intl-list-format/ |
Intl.DateTimeFormat | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat | https://github.com/tc39/proposal-intl-DateTimeFormat-formatRange | https://tc39.es/proposal-intl-DateTimeFormat-formatRange/ |
Top-level await | https://github.com/tc39/proposal-top-level-await | https://tc39.es/proposal-top-level-await/ |
ES11(2020)
特性 | MDN | proposal | tc39 |
import | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/import | https://github.com/tc39/proposal-dynamic-import | https://tc39.es/proposal-dynamic-import/ |
空值合并运算符(??) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator | https://github.com/tc39/proposal-nullish-coalescing | https://tc39.es/proposal-nullish-coalescing/ |
可选链运算符(?.) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Optional_chaining | https://github.com/tc39/proposal-optional-chaining | https://tc39.es/proposal-optional-chaining/ |
globalThis | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/globalThis | https://github.com/tc39/proposal-global | https://tc39.es/proposal-global/ |
Promise.allSettled() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled | https://github.com/tc39/proposal-promise-allSettled | https://tc39.es/proposal-promise-allSettled/ |
for...in | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/for...in | https://github.com/tc39/proposal-for-in-order | https://tc39.es/proposal-for-in-order/ |
ES10(2019)
特性 | MDN | proposal | tc39 |
Array.prototype.flat() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/flat | https://github.com/tc39/proposal-flatMap | https://tc39.es/proposal-flatMap/ |
Array.prototype.flatMap() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap | https://github.com/tc39/proposal-flatMap | https://tc39.es/proposal-flatMap/ |
String.prototype.matchAll() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll | https://github.com/tc39/proposal-string-matchall | |
Symbol.prototype.description | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Symbol/description | https://github.com/tc39/proposal-Symbol-description | https://tc39.es/proposal-Symbol-description/ |
Object.fromEntries() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries | https://github.com/tc39/proposal-object-from-entries | https://tc39.es/proposal-object-from-entries/ |
无条件的catch块 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/try...catch#%E6%97%A0%E6%9D%A1%E4%BB%B6%E7%9A%84catch%E5%9D%97 | ||
BigInt | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/BigInt | https://github.com/tc39/proposal-bigint | https://tc39.es/proposal-bigint/ |
Object.prototype.toString() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/toString | ||
String.prototype.trimStart() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart | https://github.com/tc39/proposal-string-left-right-trim | https://tc39.es/proposal-string-left-right-trim/ |
String.prototype.trimEnd() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd | https://github.com/tc39/proposal-string-left-right-trim | https://tc39.es/proposal-string-left-right-trim/ |
ES9(2018)
特性 | MDN | proposal | tc39 |
异步迭代(Symbol.asyncIterator) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator | https://github.com/tc39/proposal-async-iteration | https://tc39.es/proposal-async-iteration/ |
Promise.prototype.finally() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally | https://github.com/tc39/proposal-promise-finally | https://tc39.es/proposal-promise-finally/index.html |
正则表达式 Unicode | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions/Unicode_Property_Escapes | https://github.com/tc39/proposal-regexp-unicode-property-escapes | https://tc39.es/proposal-regexp-unicode-property-escapes/ |
正则表达式断言(Assertions) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions/Assertions | https://github.com/tc39/proposal-regexp-lookbehind | https://tc39.es/proposal-regexp-lookbehind/ |
剩余参数(Rest) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | https://github.com/tc39/proposal-object-rest-spread | https://tc39.es/proposal-object-rest-spread/ |
展开语法(Spread) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/Rest_parameters | https://github.com/tc39/proposal-object-rest-spread | https://tc39.es/proposal-object-rest-spread/ |
ES8(2017)
特性 | MDN | proposal | tc39 |
Object.entries/values() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/valueshttps://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/entries | https://github.com/tc39/proposal-object-values-entries | https://tc39.es/proposal-object-values-entries/ |
展开语法(Spread) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/Rest_parameters | https://github.com/tc39/proposal-object-rest-spread | https://tc39.es/proposal-object-rest-spread/ |
SharedArrayBuffer | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer | https://github.com/tc39/proposal-ecmascript-sharedmem | |
正则表达式dotAll 属性(RegExp.prototype.dotAll) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll | https://github.com/tc39/proposal-regexp-dotall-flag | https://tc39.es/proposal-regexp-dotall-flag/ |
ES7(2016)
特性 | MDN | proposal | tc39 |
includes | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/includes | https://github.com/tc39/proposal-Array.prototype.includes | |
求幂 (**) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Exponentiation | https://github.com/tc39/proposal-exponentiation-operator | https://tc39.es/ecma262/#sec-exp-operator |
Object.getOwnPropertyDescriptors() | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptors | https://github.com/tc39/proposal-object-getownpropertydescriptors | https://tc39.es/proposal-object-getownpropertydescriptors/ |
ES6(2015)
特性 | MDN | 阮一峰老师https://wangdoc.com/es6/ | tc39 |
let | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/let | https://wangdoc.com/es6/let.html | |
const | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/const | https://wangdoc.com/es6/let.html | |
解构赋值 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment | https://wangdoc.com/es6/destructuring.html | |
展开语法 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | ||
字符串方法 | https://developer.mozilla.org/zh-CN/docs/Learn/JavaScript/First_steps/Useful_string_methods | https://wangdoc.com/es6/string-methods.html | |
模板字符串(Template_literals) | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Template_literals | https://wangdoc.com/es6/string.html#%E6%A8%A1%E6%9D%BF%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E9%99%90%E5%88%B6 https://github.com/tc39/proposal-template-literal-revision | https://tc39.es/proposal-template-literal-revision/ |
正则扩展 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp | https://wangdoc.com/es6/regex.html | |
数值扩展 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number | https://wangdoc.com/es6/number.html | |
函数扩展 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Functions | https://wangdoc.com/es6/function.html | |
数组扩展 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array | https://wangdoc.com/es6/array.html | |
对象扩展 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object | https://wangdoc.com/es6/object.html | |
对象新增方法 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object | https://wangdoc.com/es6/object.html | |
运算符扩展 | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Expressions_and_Operators | https://wangdoc.com/es6/operator.html | |
Symbol | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Symbol | https://wangdoc.com/es6/symbol.html | |
Set、Map | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map | https://wangdoc.com/es6/set-map.html | |
Proxy | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy | https://wangdoc.com/es6/proxy.html | |
Reflect | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect | https://wangdoc.com/es6/reflect.html | |
Promise | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise | https://wangdoc.com/es6/promise.html | |
Iterator、for…of | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Iterators_and_Generators https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/for...of https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Iteration_protocols | https://wangdoc.com/es6/iterator.html | |
Generator | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Generator | https://wangdoc.com/es6/generator.html https://wangdoc.com/es6/generator-async.html | |
Async | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/async_function | https://wangdoc.com/es6/async.html | |
Class | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Classes | https://wangdoc.com/es6/class.html https://wangdoc.com/es6/class-extends.html | |
Module | https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Modules | https://wangdoc.com/es6/module.html https://wangdoc.com/es6/module-loader.html |
附录
https://github.com/tc39/ecma262
https://github.com/tc39/proposals
https://github.com/JSCIG/es-discuss/discussions
https://github.com/tc39/proposals
https://github.com/tc39/agendas
https://github.com/tc39/test262
https://www.ecma-international.org/news/ecma-international-approves-new-standards-6/
https://www.ecma-international.org/
https://tc39.es/process-document/
https://262.ecma-international.org/
https://tc39.es/zh-Hans/
https://ecma262.docschina.org/