0

what is difference between var & let ?

7th Nov 2017, 5:55 AM
sambasiva
2 Answers
7th Nov 2017, 6:24 AM
Kamil
Kamil - avatar
+ 2
This is a scope problem. Var is scoped to the nearest function while let is scoped to the nearest block (ie a if statement)
7th Nov 2017, 6:22 AM
Drax
Drax - avatar