string.replace() combined with a global regular expression code example
Example 1: str replace javascript all
str.replace(/abc/g, '');
Example 2: javascript replaceall
//as of August 2020, not supported on older browsers
str.replaceAll("abc","def")