- Instant help with your JavaScript coding problems
replace
The replace() method returns a new string with some or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp.
JavaScript:
replace(substr, newSubstr)
TypeScript:
replace(searchValue: string | RegExp, replaceValue: string): string;

Related snippets