0
Var vs Let in Javascript
Which do you use? Why? Can you give an example to convey your point?
2 Respuestas
+ 1
I’m by no means an expert but, seeing that you’ve a lack of answers so far, I’ll venture a response.
As far as I know, let is the more modern usage and var is becoming deprecated. But, because of issues of readability with older browsers, some programmers keep using var to cater for all browsers.
There are a few differences with behaviour too, but I can’t remember what.
0
Var is not going to be deprecated. Var define global scope variables while in another hand, Let define "Block, expressions, functions" variables. However, Let is not hoisting.