Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES2022 #8

Open
luoway opened this issue Jun 24, 2023 · 0 comments
Open

ES2022 #8

luoway opened this issue Jun 24, 2023 · 0 comments
Labels
deploy deploy to gh-page

Comments

@luoway
Copy link
Owner

luoway commented Jun 24, 2023

模块顶层await

tc39/proposal-top-level-await

#x私有属性、私有方法

tc39/proposal-class-fields

#x in obj检查存在私有属性、方法

tc39/proposal-private-fields-in-in

class静态块

tc39/proposal-class-static-block

正则d修饰符

tc39/proposal-regexp-match-indices
新增d修饰符,可以让exec()match()的返回结果添加indices属性,在该属性上面可以拿到匹配的开始位置和结束位置。

const text = 'zabbcdef';
const re = /ab/d;
const result = re.exec(text);

result.index // 1
result.indices // [ [1, 3] ]

err.cause

tc39/proposal-error-cause

const actual = new Error('an error!', { cause: 'Error cause' });
actual.cause; // 'Error cause'

str.at()arr.at()

tc39/proposal-relative-indexing-method

const sentence = 'This is a sample sentence'

sentence.at(0); // 'T'
sentence.at(-1); // 'e'
sentence.at(100) // undefined

参考资料

@luoway luoway added the deploy deploy to gh-page label Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy deploy to gh-page
Projects
None yet
Development

No branches or pull requests

1 participant