Professional Documents
Culture Documents
School of Information Technology and Engineering Digital Assignment-1, Fall Semester-2021-22
School of Information Technology and Engineering Digital Assignment-1, Fall Semester-2021-22
8) For what purpose JSON is used? and List out the different datatypes available in JSON?
9) How is JSON different from XML?
10) Differentiate JSON.stringify() and JSON.parse().
11) Explain with an example how to read data from json file and convert it into a JavaScript
object?
12) What is the importance, and the benefits of including 'use strict' at the beginning of a
JavaScript source file?
13) Write a simple function (less than 160 characters) that returns a Boolean indicating
whether or not a string is a palindrome.
14) What is the output of the following code? Give explanation.
var length = 10;
function fn() {
console.log(this.length);
}
var obj = { length: 5, method: function(fn) { fn(); arguments[0](); } };
obj.method(fn, 1);
15) for (let i = 0; i < 5; i++) { setTimeout(function() { console.log(i); }, i * 1000 ); } What
will this code print?