JavaScript - Difference Between let, const, And var
So for those confused let, const, and var are different modes of variable declaration in JavaScript.
And I will be explaining the difference between them in this article.
- Let -
Let makes it possible for us to declare a variable without assigning any value to it yet, and also allows us to assign a temporal value to a variable, which means the variable can be assigned a new value. So it’s much easier to use when you are working with temporal values. Let is block scoped.
- Const -
Const in the other hand does the opposite of let. Meaning that we can’t declare a variable with const and not assign a value to it immediately, and the variable declared can’t be assigned another value. So const is preferably used when working in a big project or with other developers to avoid bugs and other minimal errors. const is block scoped.
Get Prince Ezechi (w)’s stories in your inbox
Join Medium for free to get updates from this writer.
. Var -
While var is the oldest means of declaring variables. There are issues associated with var which gave room to development of let and const. Var is function scoped.
N/B: Genesys Tech-Hub (learnable2022 task) by Prince Ezechi (w).





