Quiz Space

Modern Application Development II · End Term · 21 Dec 2025 · September 2025 term

Question 27: Consider the following Vue 2 (CDN) code. html code: scri…

Question 27

+5 marksOne correct option

Consider the following Vue 2 (CDN) code. html code:

script:

Based on the above data, answer the given subquestions.

Why is the watcher on $route.params.id necessary in this code?

  1. A

    Without it, the userId in data would never change when the route changes.

  2. B

    It is required because Vue Router does not automatically update component data.

  3. C

    It prevents the component from being destroyed and recreated on every navigation.

  4. D

    Both Without it, the userId in data would never change when the route changes and It is required because Vue Router does not automatically update component data are correct.

Show answer

Correct answer

  • D

    Both Without it, the userId in data would never change when the route changes and It is required because Vue Router does not automatically update component data are correct.

Question 27 of 29 in the IIT Madras BS Modern Application Development II (MAD 2) End Term paper sat on 21 Dec 2025, in the September 2025 term (Modern Application Development Ii 18 Dec 25). It carries 5 marks.

More questions from this paper

  1. Q1Considering the following code snippet, which statements are true about components in Vue?
  2. Q2Consider the following JavaScript code snippet. What will be printed on the console?
  3. Q3Which of the following is considered a good practice for securing user authentication in a web application?
  4. Q4In the following code snippet, which values should replace option1 and option2 so that the cookie is sent only over HTT…
  5. Q5When comparing Redis with a typical API data store (like a relational database accessed through REST APIs), which of th…
  6. Q6How can you stop a Cross-Site Scripting (XSS) attack?
  7. Q7Which of the following describe Redis features correctly?
  8. Q8Which of the following is true about Vuex state?
  9. Q9What is the purpose of Redis in a Celery-based system?
  10. Q10What happens to the fetch call when it gets a 404 status code (page not found)?
  11. Q11Consider the following JavaScript snippet. What will be printed on the browser's console?
  12. Q12Consider the following JavaScript snippet: What will be printed on the browsers' console?
  13. Q13Consider the following Vue Router setup and HTML. Suppose the webpage is served at http://127.0.0.1:5000. A user visits…
  14. Q14Consider the following JavaScript code snippet where a web application manages user preferences using localStorage. A u…
  15. Q15A developer creates a Vue component using both v-if and v-show directives on different elements with initially false co…
  16. Q16A Promise chain is created as follows. The first Promise resolves with a string, which is then processed through multip…
  17. Q17A JavaScript object is created and then assigned to another variable. Modifications are made through both variables. Wh…
  18. Q18Which of the following statements about the "this" keyword in JavaScript are correct?
  19. Q19A Vue Router application uses lazy-loaded route components. When a user navigates to a route with a dynamic parameter (…
  20. Q20A developer uses sessionStorage to store authentication tokens in a web application. The user logs in, the token is sto…
  21. Q21A developer creates a Vue component with prototype chain inspection. The component uses class-based inheritance with li…
  22. Q22In a web application using webhooks and Redis for real-time data synchronization:\ Scenario: An order management system…
  23. Q23Consider the Vue application. Based on the above data, answer the given subquestions. What happens when the user clicks…
  24. Q24Consider the Vue application. Based on the above data, answer the given subquestions. Under which condition will the co…
  25. Q25Consider the Vue application. Based on the above data, answer the given subquestions. What are the benefits of computed…
  26. Q26Consider the following Vue 2 (CDN) code. html code: script: Based on the above data, answer the given subquestions. Wha…
  27. Q28Consider the following Vue.js application with two different route scenarios and a component that uses reactive data bi…
  28. Q29Consider the following Vue.js application with two different route scenarios and a component that uses reactive data bi…