In JavaScript the inner function can access the variables from the outer scope even after the outer function has returned. This is because the variables are still bound in the inner function and not dependent on the outer function. This is called closure.
True
False
3 points
QUESTION 2
Which of the following statements is true about JSON?
| a. |
JSON stands for JavaScript Object Notation. |
|
| b. |
JSON is a syntax for storing and exchanging data. |
|
| c. |
JSON is text, written with JavaScript object notation. |
|
| d. |
All of the above. |
3 points
QUESTION 3
Which of the following statements is false regarding JSON syntax?
| A. |
Data are separated by semi-colons |
|
| B. |
Data are stored in name/value pairs. |
|
| C. |
Curly braces hold objects |
|
| D. |
Square brackets hold array. |
3 points
QUESTION 4
JavaScript has a built in function ____________________________ to convert a string, written in JSON format, into native JavaScript objects. If you receive data from a server, in JSON format, you can use it like any other JavaScript object.
3 points
QUESTION 5
In JSON, data are stored in name/value pairs. The name is a string written in double quotes, the value can be:
| A. |
a string |
|
| B. |
a number |
|
| C. |
an object (JSON object) |
|
| D. |
an array |
|
| E. |
a boolean |
|
| F. |
null |
|
| G. |
all of the above |
3 points
QUESTION 6
Which of the following statements are false regarding JSON objects?
| A. |
JSON objects are surrounded by curly braces {}. |
|
| B. |
JSON objects are written in key/value pairs. |
|
| C. |
Keys must be strings, and values must be a valid JSON data type (string, number, object, array, boolean or null). |
|
| D. |
keys and values are separated by a semi-colon. |
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
Question 1:
Answer :True
Explanation :In JavaScript the inner function can access the variables from the outer scope even after the outer function has returned. This is because the variables are still bound in the inner function and not dependent on the outer function. This is called closure.
**************************
Question 2:
Answer :d.All of the above
Explanation :
**************************
Question 3:
Answer :A.Data are separated by semi-colons
Explanation :Data are separated by comma and key value is separated by colon (:).
**************************
Question 4:
Answer :JSON.parse()
Explanation :JavaScript has a built in function JSON.parse() to convert a string, written in JSON format, into native JavaScript objects. If you receive data from a server, in JSON format, you can use it like any other JavaScript object.
**************************
Question 5:
Answer :G.all of the above
Explanation :JSON value is any valid javascript data type.
**************************
Question 6:
Answer :D.keys and values are separated by a semi-colon.
Explanation :In JSON keys and values are separated by colon (:)
**************************
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.
In JavaScript the inner function can access the variables from the outer scope even after the...
javascript-Write a function named "json_average" that takes a JSON formatted string as a parameter in the format of an array of objects where each object has keys "mass", "density", "temperature", and "velocity" and each key maps to a floating point number. This function should return the average "velocity" of all the objects in the array as a JSON string in the format {"velocity": }
Create a JavaScript function named display_data that has two parameters. The first parameter will be a String containing a JSON blob like the function in part 1 returns. The second parameter will be a boolean. Start by using the JSON library to convert the first parameter into a usable JavaScript Object. Next get the HTML element whose id is "data". This HTML element is a div. If the second parameter is equal to true , write the value associated with...
QUESTION 1 JSON stands for (each letter has textbox) one java script object notation 10 points aved QUESTION 2 All of the following are true for JSON, EXCEPT.. a. uses conventions of markup languages similar to HTML, XML Ob. "easy" for humans to read and write c. standardized as ECMA-262 d. "easy" for computer algorithms to parse and generate . language independent text format for data f. based on subset of JavaScript 10 points Save Answer QUESTION 3 JSON organizes...
Can someone please help me with this javascript - Javascript - do at least 10 of the following questions below ----------------------------------------------------------------------------------- Create an HTML file that takes in input and carries out of the following functions and manipulates the DOM to show the outcome. Please put the question itself as a comment above each answer. Use either JavaScript, jQuery, or both (but know the difference!). ----------------------------------------------------------------------------------- 1. Fibonacci Define function: fib(n) Return the nth number in the fibonacci sequence. 2....
Which of the following functionality can NOT be developed using JavaScript only? Question 1 options: A monthly calendar Adding some numbers A live clock showing date and time A synchronous chat room with multiple people from different places Showing different text based on time of the day. Question 2 (0.5 points) Saved In the following JavaScript statement, what is the value of course[3]? var course = new Array(4203, 89, 95, 77, 5443); Question 2 options: 4203 77 95 null 5443...
Q1) How would you declare an array of doubles called myDoubles? Arrays can be initialized in one of two ways. In one method, the array elements are placed in a list enclosed in curly braces after the array name definition. For example, the code below creates an array of ints with 3 elements: 1, 2 and 3. int[] a = {1, 2, 3, 4}; We can also initialize an array with a new construct, indicating how many elements we want...
HTML ASSIGNMENT Question 1: What is the value of the variable age after the following JavaScript statements are executed? var age = 30; age = " age is: " + age + 5; A. age is 30 B. age is + age + 5 C. age is 305 D. age is 35 Question 2: Assume there is an external JS file named "addContent.js". This file is located in the same folder as the HTML document "addContent.html". In order to make...
c++ question 1. C++ string Class What does the output look like after executing the following statements? std::string numstr = "12"; numstr += "3"; std::cout << numstr << '\n'; A. None of these. B. The snippet has syntax errors. C. 15 D.123 // 2. Let S be a class that allows integers to be stored in its objects like an array. For example, if obj is an object of S, one can write statements like obj[0] = 100; or int...
In Java programming language Please write code for the 6 methods below: Assume that Student class has name, age, gpa, and major, constructor to initialize all data, method toString() to return string reresentation of student objects, getter methods to get age, major, and gpa, setter method to set age to given input, and method isHonors that returns boolean value true for honors students and false otherwise. 1) Write a method that accepts an array of student objects, and n, the...
c++ can use if else, loop,function ,array,file
i.o.
Can not use swtich, global variables
etc..
Please do all parts. previously I post 3 time for
part1 ,2 and 3 but I can't make it into one complete program code.
I even try to post a questions ask and post the 3 parts of code for
experts to put it together. But experts said it's not enough
information. please help... Thank you !
Program Objectives: Allow students to create arrays Allow...