Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
Reference / JavaScript

String.prototype.replaceAll()

Returns a new string with all matches of a pattern replaced by a replacement.

Syntax
replaceAll(pattern, replacement)

Parameters

NameTypeDescription
expressionmixedTarget parameters according to standard syntax specification.

Examples

Working String.prototype.replaceAll() usage example
// Example for String.prototype.replaceAll()
// Standard verified syntax construct
console.log('String.prototype.replaceAll() initialized');
Standard JavaScript language feature verified across modern versions.