JSON, XML
JSON file extension
.json
In the below notation, Employee is of type { "Employee": [ "Amy", "Bob", "John" ] }
Array
What function will convert a text into a JavaScript object
JSON.parse()
JSON strings must be in
double quote
JSON syntax
- Data is in name/value pairs - Data is separated by commas - Curly braces hold objects - Square brackets hold arrays *Example*: var json-object-name={strong : number_value,......}
What is a benefit of JSON over XML?
JSON has less mark-up requirements and therefore is lighter than XML
What function will convert a JavaScript object to a JSON string?
JSON.stringify()
What does JSON stand for?
JavaScript Object Notation
In this example, what is the TYPE of employee? { "employee" : { "type" : "Director", "functions" : ['sales', 'marketing'] } }
Object
JSON elements are separated by...
comma
Which of these is proper a JSON array? Select one: a. { "letters" : [ "a", "b", "c"; ] } b. { 'letters' : {"a", "b", "c" } } c. { "letters" : [ a, b, c ] } d. { "letters" : [ "a", "b", "c" ] }
d. { "letters" : [ "a", "b", "c" ] }
In modern websites, what is the common use for JSON
to send and receive bits of data
True or False: JSON standard is an open standard
true