QuestionQ3

Data Serialization

Which two of the following statements about JSON are true?

Choose two
  • A Curly braces are used to create arrays.
  • B Square brackets are used to create arrays.
  • C Curly braces are used to create nested objects.
  • D Square brackets are used to create nested objects.
Explanation

In JSON syntax, curly braces { } are used to define objects — including objects nested inside other objects or arrays — as unordered collections of key/value pairs. Square brackets [ ] are used to define arrays, which are ordered lists of values. Therefore square brackets create arrays (not objects), and curly braces create objects, including nested objects (not arrays). This is defined in the JSON specification (ECMA-404 / RFC 8259).

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!