Paul Krill
Editor at Large

ECMAScript roadmap: New JavaScript features for 2019

news
Jul 10, 20192 mins

The committee overseeing ECMAScript has approved the specification for the next edition of JavaScript

tunnel highway driving car roadmap
Credit: pxhere

ECMAScript 2019, the latest version of the specification serving as the basis of JavaScript, has been finalized. ECMA International approved the specification in June.

The new features introduced in ECMAScript 2019 include the following:

  • Symbol.prototype.description, an accessor property whose set accessor is undefined. Its get accessor function performs steps including: Let s be this value, let sym be ? thisSymbolValue(s), and return sym.[[Description]]. The goal of this feature is to expose the [[Description]] internal slot of a symbol directly instead of only indirectly through Symbol.prototype.toString.
  • Changes to Function.prototype.toString. Revisions have been proposed such as implementations not being required to retain source text for all functions defined using ECMAScript code.
  • prototype.flatMap, a common array operation that takes a nested array structure and removes one or more levels of nesting depending on its parameter. Flat exists in array-like libraries like Lodash, which has led users to want the same functionality in vanilla JavaScript.
  • prototype.flatmap, a map followed by a flat, offers a slight convenience and slight optimization. Flatmap is convenient because flattening and mapping often are useful in the same operation. It also is an optimization because there is no need to allocate an array for the mapping just to discard it when flattening.
  • prototype.sort(), a method that sorts the elements of an array in place and returns the array, is now stable.
  • Object.fromEntries, providing for a new static method to transform a list of key value pairs to an object.
  • String.prototype.trimStart and String.prototype.trimEnd. The rationale behind these revisions is that all major engines have implemented corresponding trimLeft and trimRight functions without a standard specification. For consistency with padStart/padEnd, trimStart, trimEnd, trimLeft, and trimRight are being proposed as aliases for web compatibility.
  • Updates to JSON.stringify to emit well-formed UTF-16 (Unicode Transformation Format). Currently, ill-formed code units might be emitted for surrogate code points.
  • Optional catch binding, allowing developers to omit a catch binding when the binding would not be used.

The full ECMAScript 2019 specification can be viewed online at the ECMA International website. It also can be downloaded. Completed ECMAScript editions typically are published each June, such as last year’s ECMAScript 2018 specification.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author