350-401 · Question #1305
Which JSON script is properly formatted?
The correct answer is C. {. A properly formatted JSON script strictly follows syntax rules, using curly braces for objects, square brackets for arrays, double-quotes for keys and string values, and correct comma placement.
Question
Which JSON script is properly formatted?
Options
- A"paint":[
- B{
- C{
- D[
How the community answered
(36 responses)- A3% (1)
- C92% (33)
- D6% (2)
Why each option
A properly formatted JSON script strictly follows syntax rules, using curly braces for objects, square brackets for arrays, double-quotes for keys and string values, and correct comma placement.
Common JSON formatting errors, such as missing quotes around keys or string values, or incorrect use of delimiters, would render the script invalid.
Improper nesting of objects and arrays, unquoted keys, or incorrect data types for values are typical mistakes that make a JSON script improperly formatted.
A correctly formatted JSON script (as implied by choice C) ensures proper use of curly braces for objects, square brackets for arrays, double quotes for all keys and string values, and commas to separate elements within objects or arrays, making it parsable by JSON parsers.
Mismatched braces or brackets, or incorrect placement of colons between keys and values, are common syntactical errors that cause a JSON script to be invalid.
Concept tested: JSON syntax and formatting
Source: https://www.json.org/json-en.html
Topics
Community Discussion
No community discussion yet for this question.