DEV Community

Discussion on: Where do I start? Part 3: JavaScript

Collapse
 
zac_heisey profile image
Zac Heisey • Edited

I think Muhammad brings up some solid points here as to why you wouldn't want to use var. However, I don't agree with the author's notion that var should never be used. In fact, I'd argue that using var in the early stages of learning JavaScript will make the concept of declaring, changing, and working with variables easier to understand.

Chris Ferdinandi, a vanilla JavaScipt expert, has a nice explanation on why he doesn't use let or const in his projects: gomakethings.com/why-i-dont-use-le...

His reasoning: let and const aren't as backwards compatible as var, they can't be polyfilled, and trying to determing which type to use adds unnecessary cognitive overhead (especially for beginners).

Thread Thread
 
arximughal profile image
Muhammad Arslan Aslam

I totally agree with you. For a beginner, using var can be a good thing to understand working with variables.