The ECMAScript Language Specification continues to gain new features that aim to help developers build web applications. With the latest stable edition of the ECMAScript specification come two new features as well as various minor changes.
One of the new features is available in Firefox 52, which is now in beta and will ship in March. This feature is the exponentiation operator, which allows infix notation of exponentiation. It’s a shorter and simpler replacement for the function Math.pow.
(Related: TypeScript is turning heads in the enterprise)
Another feature is Array.prototype.includes, which is available in Firefox 43. It’s an “intuitive way to check the existence of an element in an array, replacing the array.indexOf(element) !== -1 idiom,” according to a Mozilla blog post by contributor Tooru Fujisawa.
The next edition, ECMAScript 2017, is currently in draft. It will introduce new features such as Object.values/Object.entries, Object.getOwnPropertyDescriptors, string padding, trailing commas in function parameter lists and calls, Async Functions, shared memory and atomics, and other minor changes, according to Fujisawa.
Async Functions is available in Firefox 52 in beta form. It’s designed to help with long promise chains broken up into separate scopes, letting developers write chains like asynchronous function, according to Fujisawa.
In order to get 100% on the ECMAScript 2016+ compatibility table, Firefox engineers will continue to implement new features, according to Fujisawa. Any JavaScript engineer or developer who finds bugs or performance issues can file a report in Bugzilla.