Antra interview question

What is the difference between var, let, and const?

Interview Answer

Anonymous

10 Apr 2025

We declare variables in JavaScript using var, let, and const. They differ in declaring, reassigning, scope of use, and redeclaring. "const" - block scope, can't be redaclared or reassigned. "let" - block scope, can be reassigned, but can't be redaclared. "var" - supports hoisting, function or global scope, can be redeclared and reassigned.