Can you use a trailing comma in a JSON object?
问题 When manually generating a JSON object or array, it\'s often easier to leave a trailing comma on the last item in the object or array. For example, code to output from an array of strings might look like (in a C++ like pseudocode): s.append(\"[\"); for (i = 0; i < 5; ++i) { s.appendF(\"\\\"%d\\\",\", i); } s.append(\"]\"); giving you a string like [0,1,2,3,4,5,] Is this allowed? 回答1: Unfortunately the JSON specification does not allow a trailing comma. There are a few browsers that will allow