Quiz Space

Modern Application Development II · Quiz 1 · 13 Jul 2025 · May 2025 term

Question 11: Consider the following JavaScript code snippet: What wil…

Question 11

+4.5 marksOne correct option

Consider the following JavaScript code snippet:

javascript
var globalScore = 25;
const player1 = {
score: 150,
getScore: function() {
return this.score;
},
displayScore: function(bonus) {
return this.score + (bonus || 0);
}
};
const player2 = { score: 200 };
const player3 = { score: 75 };
const method1 = player1.getScore;
const method2 = player1.getScore.bind(player2);
const method3 = player1.displayScore.bind(player3);
console.log(method1());
console.log(method2());
console.log(method3(50));
console.log(method3.call(player1, 25));

What will be the output of the above JavaScript code?

  1. A

    undefined, 200, 125, 175

  2. B

    25, 200, 125, 175

  3. C

    150, 200, 125, 100

  4. D

    25, 200, 125, 100

  5. E

    undefined, 200, 125, 100

Show answer

Correct answer

  • E

    undefined, 200, 125, 100

Question 11 of 16 in the IIT Madras BS Modern Application Development II (MAD 2) Quiz 1 paper sat on 13 Jul 2025, in the May 2025 term (IIT M DIPLOMA AN EXAM QDD2 13 July 2025). It carries 4.5 marks.

More questions from this paper

  1. Q1In Vue 2, what happens when you update a data property?
  2. Q2Consider the following HTML, with the correct Vue 2 CDN links included: Html code. script: If the user clicks the "Add …
  3. Q3Consider the following code. What will be the output?
  4. Q4Figure question
  5. Q5What will be the output of this code?
  6. Q6Which computed property implementation is INCORRECT?
  7. Q7Consider the following JavaScript code: What will be the output of the code?
  8. Q8Consider the following JavaScript code to answer the below question: What will be the result of all the console.log aft…
  9. Q9Consider the following Vue.js (Vue 2) code to answer the following question: What will be displayed when the page loads…
  10. Q10Consider the following JavaScript program: What will be the output of the above program?
  11. Q12Consider the following JavaScript code to answer the below question: Which of the following statements is/are TRUE?
  12. Q13You're building a basic Vue app using Vue 2 via CDN to show a user's login form. You want to: Show a welcome message on…
  13. Q14You're building a basic Vue app using Vue 2 via CDN to show a user's login form. You want to: Show a welcome message on…
  14. Q15Consider the following HTML with relevant Vue 2 CDN link attached and answer the given subquestions. Html file: script
  15. Q16Consider the following HTML with relevant Vue 2 CDN link attached and answer the given subquestions. Html file: script