logo CodeStepByStep logo

jsonMystery0

Language/Type: JavaScript JSON objects
Author: Melissa Hovik (on 2018/10/22)

Consider the following JSON-formatted object:

let miniJSON = {
    a : "b",
    b : "a",
    c : ["a", "b", "c"]
};

Write the JavaScript value that would be returned for each of the following statements. Include "" around any string values. If any expression would result in an error, write error as your answer.

miniJSON["a"]
miniJSON[a]
miniJSON.a
miniJSON["c"]
miniJSON["c"][0]
miniJSON["c"].length
miniJSON["c"][0].length
miniJSON["c"]["a"]

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.