Hey Guys, in this blog we are going to learn about What is the different between LET and CONST key word ( ES 6) with examples
Let's get started...
LET:
Let key word now we are using for declaring variables.
It's not like a surprise because it's come with improvement of VAR keywords.
In Let, we can declare variables like we are declaring using the VAR keyword but in LET keyword we cannot re-declare that variables like below.
but we can change the value of variable like beow
CONST:
In CONST keyword we are using when we have static value. Let assume you have one value that not going to change anywhere in the function of the file in that case we can use CONST Keywords.
we can not re-declare const variable and we can not update const keyword value like below.
but we can use it like below.
Comments
Post a Comment