Quiz Space

Modern Application Development II · Quiz 2 · 6 Aug 2023 · May 2023 term

Question 15: Consider the below Vue class bindings: Code 1: Code 2: W…

Question 15

+2 marksOne or more correct options

Consider the below Vue class bindings:

Code 1:

html
<div :class="[isActive ? 'activeClass' : '', 'errorClass']"></div>

Code 2:

html
<div :class="[{ 'activeClass': isActive }, 'errorClass']"></div>

Which of the following statement(s) is/are true?

Select all that apply.

  1. A

    Both the code snippets will render the same HTML.

  2. B

    Both the code snippets will render the different HTML.

  3. C

    The code snippet 2 will always render the element div with class “activeClass”, and “errorClass” will only be applied, if the data variable “isActive” is truthy.

  4. D

    The code snippet 1 will always render the element div with class “errorClass”, and “activeClass” will only be applied”, if the data variable “isActive” is truthy.

Show answer

Correct answers

  • A

    Both the code snippets will render the same HTML.

  • D

    The code snippet 1 will always render the element div with class “errorClass”, and “activeClass” will only be applied”, if the data variable “isActive” is truthy.

Question 15 of 16 in the IIT Madras BS Modern Application Development II (MAD 2) Quiz 2 paper sat on 6 Aug 2023, in the May 2023 term (IIT M FOUNDATION AN2 EXAM QPF2 06 Aug 2023). It carries 2 marks.

More questions from this paper

  1. Q1Consider the below javascript program. What will be the approximate value of the variable “timeDifference”?
  2. Q2Consider the following Vue application with javascript file “app.js” and markup file “index.html”. app.js: index.html: …
  3. Q3Consider the following Vue application with javascript file “app.js” and markup file “index.html”. index.html: app.js: …
  4. Q4Consider the following Vue application with javascript file “app.js” and markup file “index.html”. index.html: app.js: …
  5. Q5Consider the following Vue application with javascript file “app.js” and markup file “index.html”. index.html app.js Su…
  6. Q6Consider the below javascript program, and predict the output, if executed.
  7. Q7Which of the following is correct regarding the finally block of Promise?
  8. Q8Which of the following statements is true?
  9. Q9Consider the following Vue application with javascript file “app.js” and markup file “index.html”. index.html: Suppose …
  10. Q10Consider the following Vue application with javascript file “app.js” and markup file “index.html”. index.html: app.js: …
  11. Q11Consider the below javascript program, and predict the output, if executed.
  12. Q12Consider the below javascript program. Assuming the variable “x” passed to the “result” function is a whole number betw…
  13. Q13Which of the following statement(s) is/are true regarding javascript?
  14. Q14Figure question
  15. Q16Which of the following statement(s) is/are correct in the context of REST and GraphQL?