Quiz Space

Modern Application Development II · Quiz 2 · 3 Dec 2023 · September 2023 term

Question 7: Consider the below javascript program, and predict the ou…

Question 7

+3 marksOne correct option

Consider the below javascript program, and predict the output if executed.

javascript
let x = 5;
const obj1 = {
x : 10,
func : function () {
console.log(x * this.x)
}
}
const obj2 = {
x : 20,
func : () => {
console.log(this.x);
obj1.func.call(obj2);
}
}
obj2.func();
  1. A

    20
    100

  2. B

    5
    NaN

  3. C

    20
    NaN

  4. D

    5
    50

  5. E

    undefined
    100

  6. F

    undefined
    50

Show answer

Correct answer

  • E

    undefined
    100

Question 7 of 16 in the IIT Madras BS Modern Application Development II (MAD 2) Quiz 2 paper sat on 3 Dec 2023, in the September 2023 term (IIT M DIPLOMA AN2 EXAM QDD2 03 Dec 2023). It carries 3 marks.

More questions from this paper

  1. Q1Consider the following JavaScript code. What will be logged on to the console?
  2. Q2Consider the Vue application with markup index.html and JavaScript app.js index.html app.js Suppose the application is …
  3. Q3Consider the following Vue app with markup index.html and JavaScript app.js. index.html app.js Suppose the application …
  4. Q4Consider the following Vue application with JavaScript app.js and markup index.html index.html app.js Suppose the appli…
  5. Q5Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: If yo…
  6. Q6Consider the below javascript program, and predict the output assuming the variable “random_num” always has a value gre…
  7. Q8Consider the Vue app with markup index.html and script app.js index.html app.js Suppose the application is running on “…
  8. Q9Which of the following statements is false regarding promise in javascript?
  9. Q10Consider the following Vue app with markup index.html and JavaScript app.js. index.html app.js Suppose the application …
  10. Q11Consider the following Vue application with JavaScript app.js and markup index.html index.html app.js Suppose the appli…
  11. Q12Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppo…
  12. Q13Suppose you are organizing a ceremony to award the startup companies who have progressed considerably well in the past …
  13. Q14Which of the following is/are true regarding JSON Web Tokens?
  14. Q15Which of the following statement(s) is/are true, regarding REST and GraphQL?
  15. Q16Which of the following statement(s) is/are correct using Vuex?