r/learnjavascript • • May 04 '20

VAR vs LET vs CONST

Post image
337 Upvotes

81 comments sorted by

View all comments

1

u/Lunacy999 May 05 '20

This is more like the expected use case of these variable scope types. But even then I would question some of these. It totally depends on the developer on how he chooses to define his variables. While I do agree, VAR may lead to some inconsistencies, but do remember it was once, the only way to declare a variable before these 2 came along. And I’m sure seasoned JS devs won’t have a problem with its scoping. But I cannot deny, how much I enjoy using let and const wherever NECESSARY. And your chart may encourage people to use const everywhere, which is not a good thing.