Replace all instances of a substring in a string, using a regular expression or search string.
replaceAll(searchValue, replacement)
searchValue
A string to search for.
replacement string | function(match, …capture, offset, string, groups)
A string containing the text to replace for every successful match of searchValue in this string, or a function that returns the replacement text.
A new string.
"banana".replaceAll("an", "🍌")
"b🍌🍌a"