polyfill replaceAll

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen
2022-04-18 12:26:42 -06:00
parent 376f8b58cc
commit b6db1c9e93
3 changed files with 9 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
if (typeof String.prototype.replaceAll == "undefined") {
String.prototype.replaceAll = function (match, replace) {
return this.replace(new RegExp(match, "g"), () => replace);
};
}