Skip to content

Instantly share code, notes, and snippets.

@SerenityInAllThings
Created March 13, 2019 14:46
Show Gist options
  • Save SerenityInAllThings/e89db87178d9116ee98a92e0111a8c74 to your computer and use it in GitHub Desktop.
Save SerenityInAllThings/e89db87178d9116ee98a92e0111a8c74 to your computer and use it in GitHub Desktop.
JS replace all
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