Are trailing commas valid in JSON?
Trailing commas are not valid in JSON. {"a": 1, "b": 2,} and [1, 2, 3,] both produce a SyntaxError in JSON.parse(). This is one of the most common JSON errors — trailing commas are legal in JavaScript object literals and most modern languages, but ECMA-404 (the JSON spec) explicitly forbids them. Remove the comma after the last element in any object or array.