I have some silly issue in javascript, am so close in replacing set of characters from a string with a character, but couldn't make it completely.
Here is the code
var mystring ="[[{"id":27,"av":20}],[{"id":24,"av":20}],[{"id":28,"av":40}]]";
mystring = mystring.replace('],[', ',');
This is replacing the first occurrence of the given characters '],[' with ',' so the result is
"[[{"id":27,"av":20},{"id":24,"av":20}],[{"id":28,"av":40}]]"
What am I missing, how can I replace every occurrence of '],[' with ',' ?