How to replace all occurrences of a string in JavaScript?

How to replace all occurrences of a string in JavaScript?

More to explore

Based on this image's title: “How to replace all occurrences of a string in JavaScript?