Day 8 – Var vs Let vs Const -Learning Node JS In 30 Days [Mini series]

Day 8 – Var vs Let vs Const -Learning Node JS In 30 Days [Mini series]

Before es6 VAR was the King. We used var in everywhere we wants to declare a variable

No alt text provided for this image

var variables can be re-declared and updated

No alt text provided for this image

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

No alt text provided for this image

We use LET when their is a change of updating the variable

No alt text provided for this image

LET can be updated but not re-declared. This will give a error you can’t run code

No alt text provided for this image

So in es6 we use LET & CONST not Var!

Do you knew this before ?

Jack E. Burroughs, DDS, FAGD

Jack E. Burroughs DDS FAGD UT Dental Branch Houston. Dallas-Fort Worth. 25,000+. American Dental Association Health Policy Institute Covid-19 Impact On Dental Practices Panel

5 年

Awesome Let's Connect On LinkedIn

要查看或添加评论,请登录

Muhammad Ali的更多文章

社区洞察

其他会员也浏览了