Quiz Space

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

Question 4: Which of the following statements is true about the let, …

Question 4

+2 marksOne correct option

Which of the following statements is true about the let, const, and var keywords in JavaScript?

  1. A

    var is block-scoped, while let and const are function-scoped.

  2. B

    const variables must always be initialized at the time of declaration.

  3. C

    Variables declared with let and const are hoisted and initialized with undefined.

  4. D

    let, const, and var have identical scoping rules.

Show answer

Correct answer

  • B

    const variables must always be initialized at the time of declaration.

Question 4 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 2 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. Q5Consider the below JavaScript program. What will be the output of the above program?
  5. Q6Consider the 4 JavaScript code snippets given below. Code Snippet 1: Code Snippet 2: Code Snippet 3: Code Snippet 4: Wh…
  6. Q7Consider the below VueJS application. What will the “p” tag display when the button with the text “Click Me” is clicked…
  7. Q8Consider the following JavaScript code snippet shown below. What will be output on browser’s console for the above Java…
  8. Q9Consider the following JavaScript code snippet shown below. What will be output on browser’s console for the above Java…
  9. Q10Consider the following JavaScript code What will be the output of the code?
  10. Q11Consider the following HTML with relevant Vue CDN link attached. Given the Vue.js application above, which classes will…
  11. Q12Consider the following Vue2 app and the index file given below. index.html script.js What will be the output on the bro…
  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?