JSON 1

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What kind of format is JSON, and what does the acronym mean? Select one: a. A lightweight data-interchange format. JavaScript Object Notation. b. A lightweight database framework. JavaScript Object Notation. c. A lightweight data-interchange format. Java Objective Notion. d. A lightweight data-encoding framework. Java Omnipresent Notation.

a. A lightweight data-interchange format. JavaScript Object Notation.

True of False. The order of JSON objects is always preserved. Select one: a. False b. True

a. False

Which of these is a benefit JSON has over XML? Select one: a. JSON is more forgiving of poor formatting b. JSON has less markup requirements and therefore is lighter than XML c. JSON does not need to be stored in a file to be sent remotely d. JSON can be written poorly and still be parsed

b. JSON has less markup requirements and therefore is lighter than XML

How does JSON handle numeric values that cannot be represented by a sequence of digits (like Infiniti and Nan)? Select one: a. They are stored as strings and then converted when parsed. b. They are stored fine but it's the parsers job to convert them to numeric values. c. They are not permitted.

c. They are not permitted.

In modern websites what is the common usage for JSON? Select one: a. To store information locally. b. To store information remotely. c. To send and receive bits of data.

c. To send and receive bits of data.

What is the value of json in the following code? var cars = []; cars[0] = `Ford'; cars[1] = `Toyota'; cars[2] = `BMW'; var json = JSON.stringify({x: cars}); Select one: a. {"x":{"Ford","Toyota","BMW"}} b. {"cars":["Ford","Toyota","BMW"]} c. {"x":["Ford","Toyota","BMW"]} d. {"x":[`Ford','Toyota','BMW']}

c. {"x":["Ford","Toyota","BMW"]}

Which statement about the replacer parameter in JSON.stringify() is true? Select one: a. If null or omitted, all properties of the object are included in the resulting JSON string b. If an array, specifies the names of the properties in the object to include in the resulting JSON string c. If a function, transforms values and properties encountered while stringifying d. All three statements are true

d. All three statements are true

Which statement about the reviver parameter in JSON.parse() is true? Select one: a. A function that will be called for every key and value at every level of the final result b. Used to reform generic objects into instances of pseudo-classes c. Each value will be replaced by the result of the reviver function d. All three statements are true

d. All three statements are true

Which statement about the space parameter in JSON.stringify() is false? Select one: a. It controls spacing in the resulting JSON string b. It is an optional parameter c. All three statements are false d. It removes whitespace

d. It removes whitespace

What function will convert a JavaScript object to a JSON string? Select one: a. JSON.text() b. JSON.toString() c. JSON.serialize() d. JSON.stringify()

d. JSON.stringify()

Which of these is supported as a JSON Value type? Select one: a. Infiniti b. NaN c. Undefined d. Null

d. Null

What types of values can you have in JSON key:value pairs? Select one: a. Arrays, Primitives, and Objects stored as strings b. Strings, Arrays, and Primitives c. Strings only d. Strings, Arrays, Primitives and Objects

d. Strings, Arrays, Primitives and Objects

Which of the following is not a valid way to parse JSON string? Select one: a. JSON.eval() b. jQuery.parseJSON() c. JSON.parse() d. eval()

a. JSON.eval()

Which is true about JSON namespacing? Select one: a. JSON doesn't have namespaces. Though every object is inherently a namespace. b. JSON namespaces can be accessed after parsing data. c. JSON namespaces can be accessed immediately after receiving data.

a. JSON doesn't have namespaces. Though every object is inherently a namespace.

What is the value of json in the following code? var obj = { fruit: `apple', toJSON: function () { return `orange'; } }; var json = JSON.stringify({x: obj}); Select one: a. {"x":"orange"} b. {"fruit":"orange"} c. {"x":"apple"} d. {"fruit":"apple"}

a. {"x":"orange"}

Which of the following control characters cannot be used when writing a JSON string without escaping? Select one: a. / or { b. " or \ c. ; or : d. < or >

b. " or \

True or false? A disadvantage of JSON is that it requires the use of JavaScript. Select one: a. True, though JavaScript is readily available in today's browsers. b. False, JSON is language independent. c. False, JavaScript must be available although it is not necessary to use. d. True, though all browsers have JavaScript enabled.

b. False, JSON is language independent.

What is a JSONStringer used for? Select one: a. It is used to create number strings in JSON. b. It is used to quickly create JSON text. c. It is used to create JSON ordered pairs. d. It quickly converts JSON to Java strings.

b. It is used to quickly create JSON text.

In what situation would you want to use XML over JSON? Select one: a. When JSON is not offered. b. You need message validation or you're using XSLT. c. Never, JSON is worlds better. d. When you need to use tags to structure your content.

b. You need message validation or you're using XSLT.

Can you use a double quote inside a JSON string? Select one: a. No, you should use single quotes b. Yes, if you use the ascii code. c. Yes, if it is escaped like ( \" ) d. Yes, you can use it without any special treatment

c. Yes, if it is escaped like ( \" )


Ensembles d'études connexes

Texas History/ Foundation, Skills, Research, and Instructions

View Set

Iggy Chapter 58: Care of PTs with Liver Problems

View Set

Chapter 13 Diversity And Difference in Health Care Key Terms

View Set

Microbiology Chapter 4 Self-Quiz

View Set