Automation and Artificial Intelligence

A parser accepts any standalone JSON value, without requiring an object at the document root. Which files can it parse successfully? (Choose three.)

Choose 3 answers

Show the answer

Correct answersA. "ready"B. [1, "up", {}]D. {}

AWhy this is right: A string is a valid standalone JSON value; an object wrapper is not required.

BWhy this is right: JSON arrays may mix numbers, strings, and objects.

CWhy not this: JSON has no set literal; an object requires named members rather than bare values.

DWhy this is right: An object may contain zero members and serve as the document root.

EWhy not this: JavaScript defines undefined, but JSON does not include it among its value types.

A JSON document may contain a string, an empty object, or an array with mixed value types at its root. Brace-enclosed values without member names resemble a set, not a JSON object; undefined is not a JSON value.