r/javascript • • May 28 '19

What are some JavaScript things beginners don't know?

333 Upvotes

383 comments sorted by

View all comments

141

u/inabahare May 28 '19

Using const and let

0

u/[deleted] May 28 '19

[deleted]

33

u/[deleted] May 28 '19

VSCode masterrace but WebStorm is right here. (Modern) JS shouldn't use var when not explicitly needed.

26

u/[deleted] May 28 '19 edited May 28 '19

It's not an IDE that errors anything, it's linters. And VSCode comes with ESLint which gives a warning for var usage with default rules, so idk what you're talking about.

5

u/ingrown_hair May 28 '19

What’s a good lint rule set for beginners? I’ve been writing JS for 6 years. I recently started with the AirBnB set and it’s draining my will to live.

3

u/Choltzklotz May 28 '19

protip: edit the config to only warn (or even disable) some stuff while writing (whitespace stuff mostly), and fix all of them at once before deployment. saved me a ton of nerves

2

u/ScientificBeastMode strongly typed comments May 28 '19

This is exactly what I do. I find it infuriating when I have an extra compile step in development just to fix some white space errors.