JSON Data Types: Unordered Set of Attribute-Value Pairs

JSON Data Types: Unordered Set of Attribute-Value Pairs


Which JSON data type is an unordered set of attribute-value pairs?



Click on the arrows to vote for the correct answer

A. B. C. D.


The JSON (JavaScript Object Notation) data format is a lightweight and easy-to-read way of transmitting data over the web. It is a text-based format and is often used to transmit data between web applications and servers. JSON data consists of a collection of name-value pairs, where the names are strings and the values can be any valid JSON data type.

The answer to the given question is D. Object.

An object is a collection of unordered name/value pairs. It starts with a left brace '{' and ends with a right brace '}'. Each name is followed by a colon ':' and then the value. The name/value pairs are separated by commas ','.

For example, consider the following JSON object:

{ "name": "John Doe", "age": 30, "isMarried": true, "hobbies": ["reading", "traveling"] }

Here, "name", "age", "isMarried", and "hobbies" are the names of the attributes, and their values are "John Doe", 30, true, and ["reading", "traveling"], respectively. The order of the attributes is not significant, and they can appear in any order.

Therefore, the correct answer to the question is D. Object.