Quiz Space

Modern Application Development II · Quiz 1 · 23 Feb 2025 · January 2025 term

Question 12: Consider the following Vue2 app and the index file given…

Question 12

+4.5 marksOne correct option

Consider the following Vue2 app and the index file given below.

index.html

html
<body>
<div id="app">
<h4>{{ state }}</h4>
</div>
<script
src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js">
</script>
<script src="./script.js"></script>
</body>
</html>

script.js

javascript
const app = new Vue({
el: '#app',
data: {
terminal: ['3','2','1'],
curr_status: ["arrived", "departed", "delayed"]
},
computed: {
state: () => {
return `The flight 103 has ${this.curr_status[1]} from terminal
${this.terminal[2]}.`
}
}
})

What will be the output on the browser?

  1. A

    The flight 103 has departed from terminal 1.

  2. B

    The flight 103 has arrived from terminal 2.

  3. C

    The flight 103 has delayed from terminal 3.

  4. D

    The flight 103 has from terminal.

  5. E

    ReferenceError

Show answer

Correct answer

  • E

    ReferenceError

Video solution

The video solution to this question is being recorded and will play here. Until then, the answer key is above.

Question 12 of 16 in the IIT Madras BS Modern Application Development II (MAD 2) Quiz 1 paper sat on 23 Feb 2025, in the January 2025 term (IIT M DIPLOMA AN EXAM QDD2 23 Feb 2025). It carries 4.5 marks.

More questions from this paper

  1. Q1Which of the following statements is true regarding “v-if” and “v-show” directives in VueJS?
  2. Q2Consider the below JavaScript program. What will be the output of the above program?
  3. Q3What is the output of this code?
  4. Q4Which of the following statements is true about the let, const, and var keywords in JavaScript?
  5. Q5Consider the below JavaScript program. What will be the output of the above program?
  6. Q6Consider the 4 JavaScript code snippets given below. Code Snippet 1: Code Snippet 2: Code Snippet 3: Code Snippet 4: Wh…
  7. Q7Consider the below VueJS application. What will the “p” tag display when the button with the text “Click Me” is clicked…
  8. Q8Consider the following JavaScript code snippet shown below. What will be output on browser’s console for the above Java…
  9. Q9Consider the following JavaScript code snippet shown below. What will be output on browser’s console for the above Java…
  10. Q10Consider the following JavaScript code What will be the output of the code?
  11. Q11Consider the following HTML with relevant Vue CDN link attached. Given the Vue.js application above, which classes will…
  12. Q13Consider the following Vue App and the HTML document given below. index.html script.js What will be rendered on the bro…
  13. Q14Consider the following HTML with relevant Vue CDN link attached. After the code execution above, what will be displayed…
  14. Q15Consider the following HTML with relevant Vue CDN attached. If the user changes the price to 20 and then immediately ch…
  15. Q16Consider the following JavaScript Code. Which of the following expression(s) will cause an error?