Quiz Space

Modern Application Development II · Quiz 2 · 1 Dec 2024 · September 2024 term

Question 7: Consider the JavaScript code below. What will be the orde…

Question 7

+2 marksOne correct option

Consider the JavaScript code below.

javascript
console.log('Start');
Promise.resolve().then(() => {
console.log('Promise');
});
setTimeout(() => {
console.log('Timeout');
}, 0);
console.log('End');

What will be the order of logs in the console?

  1. A

    Start, Timeout, End, Promise

  2. B

    Start, Promise, End, Timeout

  3. C

    Start, End, Promise, Timeout

  4. D

    Start, Promise, Timeout, End

Show answer

Correct answer

  • C

    Start, End, Promise, Timeout

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

More questions from this paper

  1. Q1Consider the below JavaScript program. What will be the output of the above program?
  2. Q2Consider the below Vue component. What will be displayed in the <p> element, after the button with text “Change Message…
  3. Q3Consider the below JavaScript program. What will be the output of the program?
  4. Q4Consider the following HTML with Vue 2 CDN attached. What will be printed in the browser console ?
  5. Q5Consider the JavaScript code snippet below. What will be logged to the console?
  6. Q6Consider the below JavaScript program. What will be the output of the above program?
  7. Q8In Vuex, what is the purpose of mutations?
  8. Q9Consider the below JavaScript program. What will be the output of the above program?
  9. Q10Consider the below Vuex implementation. After the user logs in with a token and refreshes the page, what will happen to…
  10. Q11Consider the following HTML, which includes Vue 2 and Vue Router 3 CDN links. Given this router setup, which of the fol…
  11. Q12Consider the following HTML, which includes Vue 2 and Vue Router 3 CDN links. What will be the final-rendered output in…
  12. Q13Which of the following is/are the use cases of watchers in Vue.js?
  13. Q14Which of the following statement(s) accurately describe the relationship between system state and application state?
  14. Q15Which of the following statement(s) is/are true about Vue.js components?
  15. Q16Consider the below Vue component. Which of the following statement(s) is/are correct about the behavior of the above co…