0

In JavaScript what is Difference between var, let and Const

Var x; let x; const x; What is Difference between this above keywords

20th Aug 2021, 4:06 PM
mahesh Sherekar (Kulkarni)
mahesh Sherekar (Kulkarni) - avatar
3 Respostas
+ 6
var declarations are globally scoped or function scoped while let and const are block scoped. var variables can be updated and re-declared within its scope; let variables can be updated but not re-declared; const variables can neither be updated nor re-declared. They are all hoisted to the top of their scope. Better understanding with examples =>https://codeburst.io/learn-let-var-and-const-in-easiest-way-with-guarantee-e6ecf551018a
20th Aug 2021, 4:11 PM
SAN
SAN - avatar
20th Aug 2021, 7:05 PM
The future is now thanks to science
The future is now thanks to science - avatar