Computer Science · JavaScript
Consider the following JavaScript code snippet: let x = 10; let x = 'Hello'; var y = 30; var y = 'Hi'; Which of the following statements is correct regarding the redeclaration of variables x and y?
- 1Both variables x and y can be redeclared.
- 2Both variables x and y cannot be redeclared.
- 3Variable x cannot be redeclared, but variable y can be redeclared.✓
- 4Variable x can be redeclared, but variable y cannot be redeclared.
Correct answer
Variable x cannot be redeclared, but variable y can be redeclared.
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on JavaScript?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · JavaScript