0
Var vs Let in Javascript
Which do you use? Why? Can you give an example to convey your point?
2 Answers
+ 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.