I want to change string with JavaScript, I have string which includes ), and I want to have only comma, I try it :
fields = fields.replace(/),/g , '');
but this is results in an error.
I want to change string with JavaScript, I have string which includes ), and I want to have only comma, I try it :
fields = fields.replace(/),/g , '');
but this is results in an error.
You need to escape the parenthesis because the regex engine assume it as a close capture group and replace with
,: