Which option is the JSON encoding of a dictionary/hash?
Choose an answer
Tap an option to check your answer.
Correct answer: {"key": "value"}.
Why this is the answer
The correct option, {"key": "value"}, represents a JSON object, which is the standard JSON encoding for a dictionary or hash map. It uses curly braces {} to enclose key-value pairs, where keys are strings enclosed in double quotes, followed by a colon, and then the value. The option ["key", "value"] represents a JSON array, which is an ordered list of values, not a key-value mapping. The option {"key", "value"} is syntactically incorrect JSON; curly braces denote an object, but the elements within must be key-value pairs separated by colons. The option ("key": "value") is also syntactically incorrect JSON; parentheses () are not used to define JSON objects or arrays.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed