Find and Replace with String or RegEx
The simplest replacement is substituting one string for another with `.replace()`
Code
const original = "the quick brown fox"
const updated = original.replaceAll('brown', 'green')
console.log(updated)
Results
the quick green fox
This can also be done with a regular expression
TODO: See also: `.replace()` which only does one
This is an example using a regex. You can also use a string. TKTKTK make more examples including ones with functions and strings
Code
const regex = /\d+s/g
const original = "There are 1000s and 1000s of corgis"
const updated = original.replace(regex, 'lots')
console.log(updated)
Results
There are lots and lots of corgis
More here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace