MERN STACK PAPER
Time: - 1:15 Hr Max. Marks: - 40
Section A 04
Q1. Which array method is used to add new items to the end of an array and return the new
length of the array? 02
a) shift()
b) unshift()
c) push()
d) pop()
Q2. Which of the following is a valid JavaScript data type? 02
a) Decimal
b) Double
c) BigInt
d) Float
Section B 14
Q1. Explain the difference between margin & padding in CSS. 2
Q2. Explain the difference between arrays & objects in JavaScript. 4
Q3. Write a JavaScript function called sumArray that takes an array of numbers as input and returns the sum of all
the numbers. For example array as: [2, 4, 2, 5, 2] 8
Section C 22
Q1. What is the output of the following code? 2
const obj = {id: 1001, name: 'userName'};
[Link](obj['id']);
a) 1001
b) userName
c) {id: 1001, name: 'userName'}
d) undefined
Q2. What is the reduce() method in javascript arrays? How can you use it? 4
Q3. How to merge arrays in java script using spread operator, give an example. 4
Q4. Explain the difference between synchronous and asynchronous behavior in JavaScript. 5
Q5. Write a JavaScript function called fetchData that uses the fetch API to make a GET request
to a given URL and returns the JSON response. 7