The replaceAll() method replaces every occurrence of a substring. Unlike replace(), it doesn't stop at the first match.
const text = "a-b-c";
console.log(text.replaceAll("-", " ")); // "a b c"
For basic replacements, replaceAll() is cleaner than using replace() with regex and the global flag.