百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 博客教程 > 正文

ECMAScript特性整理速览

connygpt 2024-08-21 14:44 8 浏览

首发:ECMAScript特性整理速览 · 语雀

为保证最佳的阅读体验,建议前往语雀体验[比心]


在语雀文档持续更新……

由于头条文章链接功能不理想,如需访问可以复制至浏览器进行访问[握手]

全网较(最(至少应该也排前几名吧[做鬼脸]))新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/

相关推荐

自学Python,写一个挨打的游戏代码来初识While循环

自学Python的第11天。旋转~跳跃~,我~闭着眼!学完循环,沐浴着while的光芒,闲来无事和同事一起扯皮,我说:“编程语言好神奇,一个小小的循环,竟然在生活中也可以找到原理和例子”,同事也...

常用的 Python 工具与资源,你知道几个?

最近几年你会发现,越来越多的人开始学习Python,工欲善其事必先利其器,今天纬软小编就跟大家分享一些常用的Python工具与资源,记得收藏哦!不然下次就找不到我了。1、PycharmPychar...

一张思维导图概括Python的基本语法, 一周的学习成果都在里面了

一周总结不知不觉已经自学Python一周的时间了,这一周,从认识Python到安装Python,再到基本语法和基本数据类型,对于小白的我来说无比艰辛的,充满坎坷。最主要的是每天学习时间有限。只...

三日速成python?打工人,小心钱包,别当韭菜

随着人工智能的热度越来越高,许多非计算机专业的同学们也都纷纷投入到学习编程的道路上来。而Python,作为一种相对比较容易上手的语言,也越来越受欢迎。网络上各类网课层出不穷,各式广告令人眼花缭乱。某些...

Python自动化软件测试怎么学?路线和方法都在这里了

Python自动化测试是指使用Python编程语言和相关工具,对软件系统进行自动化测试的过程。学习Python自动化测试需要掌握以下技术:Python编程语言:学习Python自动化测试需要先掌握Py...

Python从放弃到入门:公众号历史文章爬取为例谈快速学习技能

这篇文章不谈江流所专研的营销与运营,而聊一聊技能学习之路,聊一聊Python这门最简单的编程语言该如何学习,我完成的第一个Python项目,将任意公众号的所有历史文章导出成PDF电子书。或许我这个Py...

【黑客必会】python学习计划

阅读Python文档从Python官方网站上下载并阅读Python最新版本的文档(中文版),这是学习Python的最好方式。对于每个新概念和想法,请尝试运行一些代码片段,并检查生成的输出。这将帮助您更...

公布了!2025CDA考试安排

CDA数据分析师报考流程数据分析师是指在不同行业中专门从事行业数据搜集、整理、分析依据数据作出行业研究评估的专业人员CDA证书分为1-3级,中英文双证就业面广,含金量高!!?报考条件:满18...

一文搞懂全排列、组合、子集问题(经典回溯递归)

原创公众号:【bigsai】头条号:程序员bigsai前言Hello,大家好,我是bigsai,longtimenosee!在刷题和面试过程中,我们经常遇到一些排列组合类的问题,而全排列、组合...

「西法带你学算法」一次搞定前缀和

我花了几天时间,从力扣中精选了五道相同思想的题目,来帮助大家解套,如果觉得文章对你有用,记得点赞分享,让我看到你的认可,有动力继续做下去。467.环绕字符串中唯一的子字符串[1](中等)795.区...

平均数的5种方法,你用过几种方法?

平均数,看似很简单的东西,其实里面包含着很多学问。今天,分享5种经常会用到的平均数方法。1.算术平均法用到最多的莫过于算术平均法,考试平均分、平均工资等等,都是用到这个。=AVERAGE(B2:B11...

【干货收藏】如何最简单、通俗地理解决策树分类算法?

决策树(Decisiontree)是基于已知各种情况(特征取值)的基础上,通过构建树型决策结构来进行分析的一种方式,是常用的有监督的分类算法。决策树算法是机器学习中的一种经典算法,它通过一系列的规则...

面试必备:回溯算法详解

我们刷leetcode的时候,经常会遇到回溯算法类型题目。回溯算法是五大基本算法之一,一般大厂也喜欢问。今天跟大家一起来学习回溯算法的套路,文章如果有不正确的地方,欢迎大家指出哈,感谢感谢~什么是回溯...

「机器学习」决策树——ID3、C4.5、CART(非常详细)

决策树是一个非常常见并且优秀的机器学习算法,它易于理解、可解释性强,其可作为分类算法,也可用于回归模型。本文将分三篇介绍决策树,第一篇介绍基本树(包括ID3、C4.5、CART),第二篇介绍Ran...

大话AI算法: 决策树

所谓的决策树算法,通俗的说就是建立一个树形的结构,通过这个结构去一层一层的筛选判断问题是否好坏的算法。比如判断一个西瓜是否好瓜,有20条西瓜的样本提供给你,让你根据这20条(通过机器学习)建立起...