I am starting a series on node js. Actually I’m not super skilled with node js. So I thought let’s start from zero again and help others with me to learn about it. I saw the ‘the net ninja’ tutorials and took the syllabus from there and make a fusion of my own. I want to help you with my journey, let’s ride together into node js for 30 days…
Day 8 — Var vs Let vs Const — Learning Node JS In 30 Days [Mini series]
A full series to learn the basics easily of node js
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 ?
Originally it published on nerdjfpb blog and graphical version on instagram. you can connect with me in twitter, linkedin or instagram