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

Joe Steinbring @steinbring

About: I write JavaScript by day and whatever interests me by night. I travel, have dogs, and enjoy playing with my ukulele.

Location:
Glendale, WI
Joined:
Feb 8, 2017

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

Publish Date: Sep 5 '21
0 0

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.

Comments 0 total

    Add comment