function replaceAll(string, search, replace) { return string.split(search).join(replace); } const output = replaceAll(Url, type, changeType);