DEV Community

Joe Steinbring
Joe Steinbring

Posted on • Originally published at on

New things in ECMAScript 2021: String.prototype.replaceAll()

This is going to be a pretty quick post. I was skimming through what is new in ECMAScript 2021 and spotted replaceAll(). It is already supported in everything except for Internet Explorer. Let’s take a look at a quick example.

The reference is within computed properties but this definitely does not require vue. As you can see, it works the same as replace() but it just doesn’t stop at the first instance.

Have any questions, comments, etc? Feel free to drop a comment, below.

Discussion (0)