UPDATE: Visual Studio Code now ships with a built-in debugger for Chrome and Edge, so there’s no installation required. You can learn more about the current state of VS Code debugging support over here.
I’ve written before about how JavaScript is a surprisingly solid first language for beginners. However, there’s a catch. If you want to spend as much time as possible learning, and as little time as possible being frustrated, you need your programming environment to provide two essential features:
- Error checking. It’s no fun when minor misspellings, inconsistent capitalization, and other tiny typos cause big problems. A good programming environment catches these issues before they blow up.
- Debugging. Some mistakes aren’t just a matter of syntax. To solve these problems, you need tools that can help you dig into your code and see what it’s actually doing (as opposed to what you think it’s doing).
If you’re working with my favorite HTML and JavaScript editor, the free Visual Studio Code, you get error checking for free. All you need to do is stick a special @ts-check comment at the top of your JavaScript files, like this: