JSON Flashcards

1
Q

What does JSON stand for?

A

JAVASCRIPT OBJECT NOTATION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the purpose of JSON?

A

To allow data to be sent back and forth as simple text that most programming languages can read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give an example of what JSON looks like

A

{
“breed: “Coton de Tulear”,
“name”: “Isabella”,
“color”: “white”
}
//notice that there is no comma after the last value pair

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Give an example of a JSON object as an array

A

{
“myCars”: {
“make”: “BMW”,
“model”: “128I”
},
{
“make”: “Honda”,
“model”: “Ridgeline”
}
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Because it is so similar to JS format, JSON can be used directly in JS

A

Incorrect. JSON must be parsed to be used in JS. To do this we use method JSON.parse()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the two main methods used with JSON data

A

To parse into a JS object use JSON.parse()

To turn a JS object into JSON use JSON.stringfy(jsObject)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly