What is the difference between let, var and const keyword in JavaScript ?

Forums JavaScriptWhat is the difference between let, var and const keyword in JavaScript ?
Staff asked 3 years ago

Answers (1)

Add Answer
Staff answered 3 years ago
Var Let Cosnt
A var variable’s scope is functional scope. A let variable’s scope is block scope. A let variable’s scope is block scope.
It is possible to update and re-declare it in the scope. It can be modified, but not re-declared in the scope. It cannot be changed or added to the scope.
It can be defined without being initialized. It can be defined without being initialized. It cannot be defined without first being initialized.

Subscribe

Select Categories