Remove extra comma in JS