DEV Community

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

Collapse
 
thebearingedge profile image
Tim Davis

I teach var first because:

  1. It's still out there and I don't want my students seeing it at work and thinking "why didn't my teacher tell me about something so basic?"
  2. It behaves differently from let and const and it's completely different to have a pure academic or a "theoretical" understanding of something and having real hands-on (for more than an hour or some tweet's worth of words) experience with something.
  3. Knowing about and being competent when dealing with all three is better than knowing about and being competent when dealing with only two of the three (66% is a D, great job).
  4. Block scoping is a good transform output to demonstrate when teaching Babel.
  5. I ask for let and const to be used later in my curriculum where appropriate.

I don't really know who this article is for, but sadly it seems to encourage ignorance in exchange for cool coins.