1// String.prototype.replaceAll(searchValue, replaceValue)
2
3'x'.replace('', '_');
4// → '_x'
5
6'xxx'.replace(/(?:)/g, '_');
7// → '_x_x_x_'
8
9'xxx'.replaceAll('', '_');
10// → '_x_x_x_'
1function replaceAll(string, search, replace) {
2 return string.split(search).join(replace);
3}
4const output = replaceAll(Url, type, changeType);