Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Var vs Let in Javascript
Which do you use? Why? Can you give an example to convey your point?
2 Respostas
+ 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.