In my previous post I wrote about
let keyword, in this post I would like to write about another new ECMAScript 6 keyword,
There is no much difference between
let, both works similar way , both are having same level of scope.
Which means constants which are declared with
const keyword are block scoped local variables which means they are limited in scope to the block, statement, or expression on which it is used.
We can not re-assign a value to constant, and you can not re-declare a constant . For example, if we have
const a = 1, and then later down in the same code block, if we try to reassign
const a = 2 or
let, you get the same type of scoping, and just slightly different behavior with respect to reassigning/redefining values.
A constant cannot share its name with a function or a variable in the same scope.
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.