You still havent provide valid reasoning behind this…
This is a very well known recommendation.
Who, apart from you, recommends it?
Damn near everyone. If you have done professional work in Javascript, you should be aware of this general recommendation.
The scope symantics are clearer and there is less surprising behavior with let
and const
. var
is just for legacy code.
It’s such a common rule that you can lint for it
2 Likes
let
and const
are a replacement for var
. The way var
works can’t be changed. var
may well be a better name, but that name is already taken. So common names for variables used by other languages were adopted.
2 Likes
I havent done JS professionally…
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.