Created
December 1, 2018 18:54
-
-
Save chris-sev/fcd4396ee879d3ccc306512a59e2608a to your computer and use it in GitHub Desktop.
Replace All with RegExp()
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
const myMessage = 'this is the sentence to end all sentences'; | |
const newMessage = myMessage.replace(new RegExp('sentence', 'g'), 'message'); | |
console.log(newMessage); // this is the message to end all messages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment