var checked1 = JSON.parse(Cookies.get('checkedValues'));
Now the checked1 contains: ,1
I used the following code to remove the trailing comma.
var checked = checked1.replace(/(^,)|(,$)/g, "");
But now i'm getting an error
Uncaught TypeError: checked1.replace is not a function
checked1object