String replace patterns: $$ becomes a single $ in replacement strings
@alandev03▲ 0 net votes
In String.prototype.replace and replaceAll, a replacement string treats $& as the match and $$ as one dollar sign. So replaceAll('.', '$$') turns a.b.c into a$b$c, not a$$b$$c. Pass a function as the replacement when the text contains literal $ characters.