Remove trailing commas in array and object lists