DEV Community

Discussion on: var, let & const in JavaScript

Collapse
 
anirudh711 profile image
Anirudh Madhavan

Main problem with var is the concept of 'hoisting'. It is better to stick with const and let.
More on w3schools.com/js/js_hoisting.asp

Collapse
 
kunalt96 profile image
Kunal Tiwari • Edited

I really appreciate it. Hoisting is a seprate concepts in JavaScript related to the var keyword. I didn't put that in the article here. But was expecting some discussion on this :). Will definitely talk about it on next article. Glad you read it. Let and const are additions but they are the best for variables declaration in js due to these certain side effects