I have seen valid JSON written this way:
{ "version": 1
, "object":
{ "one": 1
, "two": 2
, "three": 3
, "four": 4,
, "five": 5
}
, "array":
[ 1
, 2
, 3
]
, "people":
[ { "firstname": "Jacob",
, "lastname": "Ford"
}
, { "firstname": "Marcin"
, "lastname": "Wichary"
}
]
}
My guess as to the the primary advantage is that the addition or removal of one line of data will (with a few exceptions) be diff'd as just that: a single-line addition or deletion. As opposed the more typical JSON presentation, with trailing commas, where appending an item to the end of an array or object requires editing the line before it, to add a comma.
Is there a name for this JSON presentation convention, with leading commas, and commas placed in same column as opening/closing brackets?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)