I want to replace all + occurrences on this string:
agheuhfu3r3wogfjnsdnvv++3fefda+3zcvfsdf342rsdff3+fwef
with this character: *
What I wrote is that and it replaces only the first occurrence
var str = "agheuhfu3r3wogfjnsdnvv++3fefda+3zcvfsdf342rsdff3+fwef";
var res = str.replace('+', '*');
What's wrong with this code?