How to replace all occurrences of a string in JavaScript
Update: In the latest versions of most popular browsers, you can use replaceAll as shown here: But check Can I use or another compatibility table first to make sure the browsers you’re targeting have added support for it first. For Node and compatibility with older/non-current browsers: Note: Don’t use the following solution in performance critical … Read more