The last time I used var was the last time I worked in a JavaScript code base in which I was the only contributor: anytime I try to use it in public, I get shot down by humans or an opinionated linter, or both π.
Ideally, I would use it more often. It's not a replacement for let or const, just like they aren't drop-in replacements for var or each other. I actually wrote about how I would prefer to use it here:
The last time I used
var
was the last time I worked in a JavaScript code base in which I was the only contributor: anytime I try to use it in public, I get shot down by humans or an opinionated linter, or both π.Ideally, I would use it more often. It's not a replacement for
let
orconst
, just like they aren't drop-in replacements forvar
or each other. I actually wrote about how I would prefer to use it here:Using JS: var
Daniel Brady γ» Jan 20 γ» 7 min read