DEV Community

Discussion on: 3 reasons to use 'var' in JavaScript

Collapse
 
raibtoffoletto profile image
Raí B. Toffoletto

Ufff.... I came here hoping that the title was sarcastic, but for a moment in the first paragraph I worried that you were REALLY to defend VAR.... 🤣. Nice writing 👍 and let's all chant "die VAR, die...."

Collapse
 
koire profile image
Koire

Var is actually used a lot in enterprise

Collapse
 
raibtoffoletto profile image
Raí B. Toffoletto

I'm not saying to go back and alter legacy code, but in 2021 you should not be writing JS with var... enterprise is a ship difficult to steer, but you can do it slowly. I don't shame on my colleagues still using jQuery to build stuff, but you can use const and let with jQuery.