Sitemap
JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

JavaScript ES2021 (ES12) Approved Features

New features in JavaScript ES2021 (ES12) that have been approved by the Ecma General Assembly

5 min readJun 26, 2021

--

Press enter or click to view image in full size
JavaScript 2021 (ES12) picture

About a year ago, I wrote an article about the new features that JavaScript would incorporate in its ES2021 specification.

Today, in June 2021, these features, along with others, have been approved.
In this article, I elaborate and detail what I wrote more than a year ago, but with the addition of the final features that have been approved.

Index

  • String.prototype.replaceAll()
  • Promise.any() and AggregateError
  • WeakRefs and FinalizationRegistry
  • Logical assignment operators
  • Numeric separators

String.prototype.replaceAll()

String.prototype.replaceAll() replace all instances of a substring in a string with another string value, without using a global regexp.

Until now, the most common way of doing this was to use a global regexp.

Consider the following code where we use a regular expression to replace the “+” character with an empty character:

--

--

Kesk -*-
Kesk -*-

Written by Kesk -*-

Software engineer - software Enthusiast - Sci-Fi writer.

JavaScript in Plain English
JavaScript in Plain English

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.