how to replace a word in a sentence javascript code example Example: replace all javascript str.split(search).join(replacement);