-
-
Save konfou/3dfa46afb0b4456cf56780f2ae4c75c5 to your computer and use it in GitHub Desktop.
replace all occurences in a string without regex #js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.replaceAll = function(foo, bar) { | |
return this.split(foo).join(bar); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment