1var stringWithCommas = 'a,b,c,d';
2var stringWithoutCommas = stringWithCommas.replace(/,/g, '');
3console.log(stringWithoutCommas);
1var purpose = "I, Just, want, a, quick, answer!";
2
3// Removing the first occurrence of a comma
4var result = purpose.replace(",", "");
5
6// Removing all the commas
7var result = purpose.replace(/,/g, "");