MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/qdmzio/difference_between_var_let_and_const/hhpyord/?context=3
r/learnjavascript • u/codedblood • Oct 22 '21
49 comments sorted by
View all comments
30
tldr; never use var and if you think your code requires var then there's something wrong with your code
-11 u/LucVolders Oct 23 '21 edited Oct 23 '21 Undoubdly unpopular opinion:Use var, declare your vars global at the beginning of your script and document and track them well. Otherwise you are a lazy programmer. Nothing wrong with var. -2 u/Tintin_Quarentino Oct 23 '21 Seconded. Although I do like the thinking of "always use const, followed by let, followed by var".
-11
Undoubdly unpopular opinion:
Use var, declare your vars global at the beginning of your script and document and track them well. Otherwise you are a lazy programmer. Nothing wrong with var.
-2 u/Tintin_Quarentino Oct 23 '21 Seconded. Although I do like the thinking of "always use const, followed by let, followed by var".
-2
Seconded. Although I do like the thinking of "always use const, followed by let, followed by var".
30
u/zerik100 Oct 22 '21
tldr; never use var and if you think your code requires var then there's something wrong with your code