Advertisement
Top
image credit: Vecteezy

ECMAScript 2021 spec for JavaScript crosses the finish line

June 23, 2021

ECMAScript 2021, the latest version of the official specification underlying JavaScript, has been formally approved, adding capabilities for strings and promises.

The specification was approved by ECMA International on June 22. ECMAScript 2021 includes the following features:

  • String.prototype.ReplaceAll, providing developers with a way to replace all instances of a substring in a string without the use of a global regexp. There is evidence that developers are trying to accomplish this in JavaScript, with a global regexp currently the most-common way of achieving this. String.prototype.replace, meanwhile, affects only the first occurrence when used with a string argument. The proposed solution would add a replaceAll method to the String prototype, providing developers with a straightforward solution.

Read More on Info World