Quiz Space

Modern Application Development II · Quiz 1 · 27 Oct 2024 · September 2024 term

Question 13: Considering the differences between “var”, “let”, and “c…

Question 13

+3 marksOne or more correct options

Considering the differences between “var”, “let”, and “const” in terms of scope, hoisting, and reassignment, which of the following statements is/are true?

Select all that apply.

  1. A

    “var” is function-scoped, hoisted, and allows reassignments.

  2. B

    “let” is block-scoped, hoisted, and allows reassignments.

  3. C

    “const” is block-scoped, hoisted, does not allow reassignments, and its value must be assigned at the time of declaration.

  4. D

    “let” and “const” behave identically except that const variables cannot be redeclared, while let variables can be redeclared in the same block.

Show answer

Correct answers

  • A

    “var” is function-scoped, hoisted, and allows reassignments.

  • B

    “let” is block-scoped, hoisted, and allows reassignments.

  • C

    “const” is block-scoped, hoisted, does not allow reassignments, and its value must be assigned at the time of declaration.

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

More questions from this paper

  1. Q1Consider the following HTML, with the correct Vue 2 CDN links included. What will be the final rendered class attribute…
  2. Q2Which of the following is an example of ephemeral state in a web application?
  3. Q3Consider the following JavaScript code What will be the output of the code?
  4. Q4Consider the following JavaScript code snippet What will be the output of the code?
  5. Q5Consider the following code snippet What will be the output after 1 second?
  6. Q6Consider the below javascript program. What will be the output of the above program?
  7. Q7Consider the below Vue component. What will be displayed in the <p> element, after the button with text “Update” is cli…
  8. Q8Consider the following HTML, with the correct Vue 2 CDN links included. What will be shown in the amount placeholder wh…
  9. Q9Consider the following HTML, with the correct Vue 2 CDN links included. What will be displayed in the <p> tags after th…
  10. Q10Consider the below javascript program. What will be the output of the above program?
  11. Q11Consider the below Vue component. What will be displayed in the <ul> when filterActive is true?
  12. Q12Which of the following statements is/are true about JavaScript’s “this” keyword behavior in different contexts?
  13. Q14Which of the following statements is/are true?
  14. Q15Which of the following scenario(s) represent ephemeral state(s) in a web application?
  15. Q16What are the differences between Vue's computed properties and methods?