Created
March 13, 2019 14:46
-
-
Save SerenityInAllThings/e89db87178d9116ee98a92e0111a8c74 to your computer and use it in GitHub Desktop.
JS replace all
This file contains 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
function replaceAll(str, valueToBeReplaced, valueToReplace) { | |
return str.split(valueToBeReplaced).join(valueToReplace); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment