









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
JAVASCRIPT Exam Questions and Answers Latest Graded A+
Typology: Exams
1 / 16
This page cannot be seen from the preview
Don't miss anything!










$("p").layout("background-color","red"); $("p").manipulate("background-color","red"); $("p").css("background-color","red"); - ✔✔$("p").css("background-color","red");
nameConflict() noNameConflict() conflict() noConflict() - ✔✔noConflict()
Both methods can be used remove() detach() - ✔✔Both methods can be used
a. / or { b. " or c. ; or : d. < or > - ✔✔b. " or What is the value of json in the following code? var obj = { fruit: apple', toJSON: function () { returnorange'; } }; var json = JSON.stringify({x: obj}); Select one: a. {"x":"orange"} b. {"fruit":"orange"} c. {"x":"apple"} d. {"fruit":"apple"} - ✔✔a. {"x":"orange"} 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 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 ( " ) 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. 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 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 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"]} 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.
d. Strings, Arrays, Primitives and Objects - ✔✔d. Strings, Arrays, Primitives and Objects 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. 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.