ECMAScript 2021 will introduce a new String method, called
replaceAll. As you can infer from the name, this method allows you to replace all the occurrences of a String in one go.
Let's see the new method in action. With the code snippet below, you replace the word "boring" with the word "powerful".
Run the above code to see what happens! However, it's important to note that the method
String.prototype.replaceAll() does not modify the string on which it's called. The method returns a new String.
Before it, you would need to use RegEx or other workarounds, which would take longer. Therefore, the new method
replaceAll is a great addition.