how to replace commas with nothing in javascript

Solutions on MaxInterview for how to replace commas with nothing in javascript by the best coders in the world

showing results for - "how to replace commas with nothing in javascript"
Christal
09 Feb 2017
1string.replace(/,/g, '-');
Leonardo
01 Feb 2016
1var myStr = 'this,is,a,test';
2var newStr = myStr.replace(/,/g, '');
3
4console.log( newStr );  // "this-is-a-test"