Quiz Space

MAD 2 End Term: 22 December 2024, Set QDF1 (September 2024 term)

Question 1

+3 marksOne correct option

Which of the following statements is true about closures in JavaScript?

  1. A

    A closure can access variables from its outer function even after the outer function has returned.

  2. B

    A closure can be created when a function is defined inside another function.

  3. C

    Closures are useful for data encapsulation and controlling access to private data.

  4. D

    All of these.

Question 2

+3 marksOne correct option

Consider the below JavaScript program.

javascript
console.log("Start");
setTimeout(function() {
console.log("Inside Timeout");
}, 0);
Promise.resolve().then(function() {
console.log("Inside Promise");
});
console.log("End");

What will be the output of the above program?

  1. A

    Start
    Inside Timeout
    Inside Promise
    End

  2. B

    Start
    Inside Promise
    Inside Timeout
    End

  3. C

    Start
    End
    Inside Timeout
    Inside Promise

  4. D

    Start
    End
    Inside Promise
    Inside Timeout

Question 3

+3 marksOne correct option

Consider the below JavaScript program.

javascript
function Person(name) {
this.name = name;
}
Person.prototype.greet = function() {
console.log("Hello, " + this.name);
};
const john = new Person("John");
john.greet();
delete john.greet;
john.greet();

What will be the output of the above program?

  1. A

    Hello, John
    TypeError: john.greet is not a function

  2. B

    Hello, John
    Hello, undefined

  3. C

    TypeError: john.greet is not a function
    TypeError: john.greet is not a function

  4. D

    Hello, John
    Hello, John

29 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the MAD 2 End Term 22 Dec 2024 Set QDF1 paper

The IIT Madras BS Modern Application Development II (MAD 2) End Term paper sat on 22 Dec 2024, in the September 2024 term, set QDF1: 32 questions for 100 marks in 180 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeatureMAD 2 End Term 22 Dec 2024 Set QDF1 at a glance
TermSeptember 2024 term
SubjectModern Application Development II
Course codeBSCS2006
Questions32
Marks100
Duration180 min
MCQ29
MSQ3
Official paperIIT M FOUNDATION DIPLOMA AN EXAM QDF3 22 Dec 2024
Negative markingNo negative marking.
Updated

Other sets that day

Same End Term, other subjects

More MAD 2