Quiz Space

Modern Application Development II · End Term · 11 Dec 2022 · September 2022 term · Set ETD1

Question 17: Consider the following javascript program, and predict t…

Question 17

+4.5 marksOne correct option

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

javascript
new Promise((arg1, arg2) => {
if (5 === "5") arg2(5)
else arg1(5)
}).
then(d => {
console.log("Checkpoint 3", d);
throw new Error(20);
return d * 5;
})
.then(d => {
console.log("Checkpoint 1", d);
return d;
})
.catch(e => {
console.log("Checkpoint 4");
return 5;
}).finally(d => {
console.log("Checkpoint 6", d);
return d * 5;
}).then(d => {
console.log("Checkpoint 2", d);
return d * 5;
})
  1. A

    Checkpoint 4 11
    Checkpoint 6 undefined
    Checkpoint 2 25

  2. B

    Checkpoint 4 11
    Checkpoint 6 25
    Checkpoint 2 125

  3. C

    Checkpoint 3 5
    Checkpoint 4
    Checkpoint 6 undefined
    Checkpoint 2 5

  4. D

    Checkpoint 3 5
    Checkpoint 4
    Checkpoint 6 NaN
    Checkpoint 2 5

Show answer

Correct answer

  • C

    Checkpoint 3 5
    Checkpoint 4
    Checkpoint 6 undefined
    Checkpoint 2 5

Question 17 of 32 in the IIT Madras BS Modern Application Development II (MAD 2) End Term paper sat on 11 Dec 2022, in the September 2022 term (IIT M DIPLOMA AN1 EXAM ETD1 11 Dec 2022). It carries 4.5 marks.

More questions from this paper

  1. Q1Consider the below Vue component and Vuex store definition. Which of the following is the best suitable definition of t…
  2. Q2Suppose you are writing an application to be used by lakhs of people, which will run a brute force algorithm and gives …
  3. Q3Which of the following statements is false regarding caching?
  4. Q4Suppose you want to store some data on the client, which has to be sent back to the server with every subsequent reques…
  5. Q5Suppose an application is being loaded from the origin <u>http://origin2.com</u>. Which of the following origins the br…
  6. Q6Which of the following shows the correct output, if the below program is executed?
  7. Q7If an application is entirely built on the client end using javascript (without a database). Which of the following sta…
  8. Q8Suppose a particular user of an application hosted on <u>http://example1.com</u> has delete privilege and URL to delete…
  9. Q9Consider the following javascript program. What will be logged on to console after executing the program?
  10. Q10Consider the following javascript code. What will be logged on the console after executing this program?
  11. Q11Consider the following javascript program. What will be logged on to console after executing this program?
  12. Q12Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppo…
  13. Q13Consider the following javascript program, and predict the output, if executed in a REPL environment.
  14. Q14Consider the below javascript program, and predict the output, if executed. Also, what will be the minimum time taken b…
  15. Q15Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppo…
  16. Q16Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppo…
  17. Q18Which of the following statement(s) is/are false in the context of point-to-point communication and message broker?
  18. Q19Which of the following statement(s) is/are false?
  19. Q20Which of the following is/are true regarding session cookies?
  20. Q21Which of the following statement(s) is/are false regarding javascript language?
  21. Q22Consider the below Vue class binding and select the incorrect option(s).
  22. Q23Which of the following statement(s) is/are true in the context of scaling a web application?
  23. Q24Which of the following statement(s) is/are true?
  24. Q25Suppose the application is running on ‘<u>http://localhost:8080</u>’. What will be rendered by the browser inside the d…
  25. Q26Suppose the application is running on ‘http://localhost:8080’. What will be rendered by the browser inside the div elem…
  26. Q27Suppose the application is running on ‘<u>http://localhost:8080</u>’. What will be rendered inside the ‘router-view’ of…
  27. Q28What will be rendered inside the ‘router-view’ of Booking component when user visits the URL ‘ <u>http://127.0.0.1:8080…
  28. Q29Suppose the application is running on ‘<u>http://localhost:8080</u>’, and a user visits the same URL. What will be rend…
  29. Q30Suppose the application is running on ‘<u>http://localhost:8080</u>’, and a user visits the same URL. What will be rend…
  30. Q31Consider the application is running on ‘http://localhost:8080’. Suppose the user visits the URL ‘ <u>http://127.0.0.1:8…
  31. Q32Suppose the user visits the URL ‘<u>http://127.0.0.1:8080/#/slot/true?offset=1</u>’, what will be rendered inside the ‘…