Question d’entretien chez Antra

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

Réponse à la question d'entretien

Utilisateur anonyme

10 avr. 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.