BT

TC39 Finalizes Feature Set for ECMAScript 2018

| by Kevin Ball Follow 3 Followers on Feb 01, 2018. Estimated reading time: 1 minute |

TC39 finalized the feature set for ES2018, the latest revision to the ECMAScript Language Specification, in their 23-25 January meeting. This update adds new features like asynchronous iterators and rest/spread operators for object destructuring and object literals, substantial updates to regular expressions, and additional updates to promises and template literals.

The newly finalized Asynchronous Iteration functionality provides native support within JavaScript for iterating over data that is fetched asynchronously, such as from a file read in Node.js or a WebSocket in the browser. Along with extending existing generator and looping functionality, the feature introduces two new keywords into the language, async and await. In a post on Hackernoon, Mostafa Gaafar explains the value of the new syntax:

Async/await is one of the most revolutionary features that has been added to JavaScript in the past few years. It makes you realize what a syntactical mess promises are, and provides an intuitive replacement.

Asynchronous Iteration is transpilable by Babel, and available natively in Node.js since version 7.6, as well as Chrome, Firefox, and Safari Technology Preview.

The new specification also adds support for spread/rest syntax on object literals, generalizing a syntax that has been supported in arrays since ES2015. In a walkthrough on the Google developer blog, Mathias Bynens explains that "Spread properties offer a more elegant alternative to Object.assign() in many situations". This functionality is also transpilable by Babel, with native support in Node since version 8.6, as well as Chrome, Firefox, and Safari Technology Preview.

The largest updates to existing functionality in the new specification are the updates to RegExp. ECMAScript 2018 adds a number of features to regular expressions that have been present in other languages but lacking in JavaScript. These features include 'Dotall mode', lookbehind assertions, named capture groups, and unicode property escapes.

A final update in the 2018 specification is to revise the functionality of template literals, allowing some sequences of characters that previously were illegal. For a definitive reference on the proposals that have been finalized, developers can check out TC39’s list of finalized proposals, or follow along the process of all active proposals in front of TC39.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT