You are on page 1of 1

School of Information Technology and Engineering

Digital Assignment-1, Fall Semester-2021-22


Course Name: CSE3002 Internet and Web Programming
1) What are the main differences between Node.js and Javascript?
2) Explain the concept of middleware in Node.js?
3) What is the package.json file?
4) List down the major benefits of using Node.js? and list some of the most commonly used
libraries in Node.js?
5) State the primary uses of Node.js.
6) What is NPM?
7) Write a PHP program to demonstrate the concept of Session Management and Cookies
e.g Implement the following cookies using PHP
• Create a cookie with a value IWP.
• The cookie should expire in 3 days
• Check whether the cookie is present in the website. If so display else throw
an error
• Check whether the cookie is enabled or not. Print the status
• Delete the created cookie before an hour
• Check whether the cookie is disabled or not. Print the status

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?

You might also like