DEV Community

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

emptyother profile image

Two "good" reasons I still use var:

  • ~Old projects that need to support IE11 and isnt transpiled.~ Oh, right, even IE11 supports let and const. Well almost, it still have a few gotchas that will never be fixed.
  • I'm also writing C# and var is stuck in my fingers. Sometimes I even miss the eslint warnings about it. Darn muscle memory.
aequinn profile image
Anthony Quinn

Number 3: kind of like old projects, you are doing any JavaScript variables in Google Tag manager, they still force you to use var, I develop the scripts with the new and am forced to roll it back to the old when try to save.