JSON quiz
Which of the following correctly sets the value to a Boolean true or false?
"key":true "key":false
The file type extension for JSON files is [filename].
.json
Which JavaScript JSON function could you use to turn the variable 'var' into a string ready to send to a web server?
JSON.stringify(var) JSON.toString(var)
What does the acronym JSON stand for?
JavaScript object notation
Which of the following is the correct way to represent an undefined value?
There isn't a way!
T/F In JSON, keys must be strings, written with double quotes.
True
T/F In JSON, string values must be written with double quotes.
True
T/F JSON is parsed into a ready-to-use JavaScript object.
True
If you have an array: [1,2,3] ...and you use JSON to stringify it, what will be the output of console.log to the result?
[1,2,3]
Which of the following is a valid JSON array?
[1,2,3]
The MIME type for JSON files is:
application/json;
Which JavaScript JSON function would you use to turn plain text, in JSON format, into a JavaScript object?
parse()
var person = {"name":"John", "age":101, "city":"Panama City"}; Which of the following options will correctly retrieve the name of the person?
person.name person["name"]
Which of the following examples uses JSON to correctly define a 'people' object with an array of 2 person objects. Each person has a first and last name (abbreviated by F and L for brevity).
{"people": [ {"F":"Apple", "L":"Balm"} , {"F":"Charlie", "L":"Daniels"} ] }