Today we’re going to learn about var
vs let
vs const
Before ES6 VAR was the King. We used var
in everywhere we wants to declare a variable
var variables
can be re-declared and updated
Now we divide var with two different types one CONST
& other LET
CONST
is declared for those value which will not changed anytime! Or will not be updated at any point. const
cannot be updated or re-declared, this will lead you to an error you if try
We use LET
when their is a change of updating the variable
LET
can be updated but not re-declared. This will give a error you can’t run code
So in es6 we use LET
& CONST
not Var
!
Do you knew this before ?
You can see the graphical version here
Originally it published on nerdjfpbblog. You can connect with me in twitter or linkedin !
You can read the old posts from here --
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 1 — Introduction - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 4 '19 ・ 1 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 2 - Install and Running Node on Window - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 5 '19 ・ 1 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 3 - JavaScript Engine - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 6 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 4 - Window === Global ? - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 7 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Top comments (2)
I constantly use const, but don't let me get started on this subject, I varely use var. 🥁
That's good! Var was mainly used before const and let.