探索 ES2018 及 ES2019 KOHAI 2018-02-21 1,800 阅读1分钟 原文链接: exploringjs.com Homepage Please support this book: buy it (PDF, EPUB, MOBI) or donate (Ad, please don’t block.) Exploring ES2018 and ES2019 Table of contents Background About this book This book isn’t finished, yet Feedback and corrections About the author The TC39 process for ECMAScript features Who designs ECMAScript? How is ECMAScript designed? Don’t call them ECMAScript 20xx features Further reading ECMAScript 2018 Asynchronous iteration Asynchronous iteration for-await-of Asynchronous generators Examples WHATWG Streams are async iterables The specification of asynchronous iteration Alternatives to async iteration Further reading Rest/Spread Properties The rest operator (...) in object destructuring The spread operator (...) in object literals Common use cases for the object spread operator Spreading objects versus Object.assign() RegExp named capture groups Numbered capture groups Named capture groups Backreferences replace() and named capture groups Named groups that don’t match Implementations Further reading RegExp Unicode property escapes Overview Unicode character properties Unicode property escapes for regular expressions Examples Trying it out Further reading RegExp lookbehind assertions Lookahead assertions Lookbehind assertions Conclusions Further reading s (dotAll) flag for regular expressions Overview Limitations of the dot (.) in regular expressions The proposal FAQ Promise.prototype.finally() How does it work? Use case .finally() is similar to finally {} in synchronous code Availability Further reading Template Literal Revision Tag functions and escape sequences Problem: some text is illegal after backslashes Solution