The replace() method of string values returns a new string with one, some, or all matches of a pattern replaced by a.. Definition and usage the replace() method replaces a specified phrase with another specified phrase.
Simple explanations to help you.. Substitute for (a person or thing).