I want to Replace 2013-2-2 to 2013,2,2
I tried
var forrep = '2013-2-2';
var text = forrep.replace('-', ',');
but it only replaces the first - the output looks like this 2013,2-2
I want all the - to be replaced by , commna
Please help Thanks