When replacing string replacement, if the new content is two consecutive $$, it will become 1 when output.
var str = '哈哈a哈哈a哈哈哈';
var re = str.replace('a','****');
console.log(re);
//结果是:哈哈****哈哈a哈哈哈
var str = '哈哈a哈哈a哈哈哈';
var re = str.replace('a','$$$$');
console.log(re);
//结果是:哈哈$$哈哈a哈哈哈
//4个$变成了2个,为什么
`
$ has special meaning in replace, just like for strings, the first transfer, $$ represents the character $
`