replace()

Programming With Text Lesson #2.9

In this video, I cover the JavaScript function replace(). The function allows you to search for a string (by matching a regular expression) and replace that string.

The replacement can be a literal string itself or you can pass in a callback where you can use logic and programming to generate a replacement string based on anything you can imagine.