Reemplace todas las comas en String JavaScript
string.replace(/,/g, '-');
Successful Sandpiper
string.replace(/,/g, '-');
var myStr = 'this,is,a,test';
var newStr = myStr.replace(/,/g, '');
console.log( newStr ); // "this-is-a-test"