r/learnjavascript • • May 04 '20

VAR vs LET vs CONST

Post image
337 Upvotes

81 comments sorted by

View all comments

81

u/senocular May 04 '20

const and let can be used in the global scope just as much as var can.

-3

u/Macaframa May 04 '20

This should say

let, const: block scoping

const: non-writable once it’s instantiated

let: only real use is in a for loop

-7

u/MrSandyClams May 04 '20

I use let 100% of the time. Reasoning: the word "const" is ugly to look at

7

u/Macaframa May 04 '20

It’s all words at the end of the day. If it gets the shitty software to the shitty client, it’s going to be declared shitty one day by another shitty developer and be rewritten by some more shitty code.

  • sincerely a disgruntled developer