What's the difference between var and let?
Anonymous
Var: It is a function scoped means a variable declared with var is defined throughout the program scope. Also var keyword are hoisted means it is initialized with undefined before the code is run. It creates a property on the global object, which can be accessed using windows object. Let: It is a block scoped means a variable declared with let is defined only within the curly braces { }. We can not redeclare the same variable in the same scope.
Check out your Company Bowl for anonymous work chats.