xxxxxxxxxx
/// replace "abc" with "" (blank string)
str.replace(/abc/g, '');
xxxxxxxxxx
// String.prototype.replaceAll(searchValue, replaceValue)
'x'.replace('', '_');
// → '_x'
'xxx'.replace(/(?:)/g, '_');
// → '_x_x_x_'
'xxx'.replaceAll('', '_');
// → '_x_x_x_'
xxxxxxxxxx
function replaceAll(string, search, replace) {
return string.split(search).join(replace);
}
const output = replaceAll(Url, type, changeType);