Const keyword in JavaScript
Before ES2015 javascript variable has only two scopes i.e. Global Scope and Function Scope.
but in ES2015 they introduced the cinst keyword. this keyword provides Block scope variables. Block scope means Variables declared inside a block {} cannot be accessed from outside the block.once you declared the constant variable you cannot declared this vsriable again.once you assigned the value in const variable, you can not reassigned value again.
Comments
Post a Comment