JavaScript replaceall
The replaceAll() method is added to String's prototype. This means it will be available for all string objects/literals.
The Syntax of replaceAll() is as follows:
str = str.replaceAll('abc', ‘xyz’);
Example1
Output
Example2
Output