0
Difference between (var ) and (let) in js ???
Difference between (var ) and (let) ???
2 Respuestas
+ 2
1. var is function scoped, which mean code outside of function can be accessible anywhere which is a bad thing. let is block scoped meaning code inside curly braces ({}) cannot be accessed from outside.
2. var is going to give undefined when accessing a variable before it's declared, let give ReferenceError when accessing a variable before it's declared.
+ 4
just google it. you will get lot of resources with various example. 👍