Learn JavaScript (step-by-step)

I've been working professionally with JavaScript for several years.

It's an awesome language. It's easy to get started and easy to be productive. It's not perfect, and definitely has it quirks - but the availability, ecosystem and community make it my favourite language by far. And the one I recommend beginners to get started with.

But that begs an interesting question: how should you get started with JavaScript? There's lots of tutorials and resources out there, most of which are great. Unfortunately, blindly following tutorials for months on end won't actually teach you how to code in JavaScript.

So if you're early in your JavaScript writing days, this step-by-step is for you. And it's how I would go about learning JS if I had to start over today:

  1. Start by picking up the basic idea from videos or articles. Don't worry about the code, but try to understand the role of JavaScript in the modern development ecosystem. Get a feel for how JS is used in the browser (front-end) and in NodeJS (back-end).

  2. Start playing around in a code editor like VS Code. Keep watching videos and reading articles, but make sure you follow along the code yourself. Learn the basics like variables, functions, loops and conditional statements. You can also use online interactive exercises if you prefer a more controlled environment.

  3. When you start to grasp the basics, it's time to build a small project. Find a tutorial to build a simple app with vanilla JavaScript. You probably don't feel ready for this yet, but getting your hands dirty right away is great. Just make sure to find a tutorial as simple as possible.

  4. Now comes the fun part. Watch / read the tutorial from end to end, without coding at all. Then, re-start it from the beginning - but this time "code along" and pause before the instructor implements something and see if you can do it yourself. Refer back to their solution when you get stuck, and go piece by piece.

  5. When you get the hang of it, try to explore new features you think could be fun. This is your app, so feel free to change anything! If the original project is a list of books, turn it into a list of movies instead. Make small changes and experiment. Keep going until the small project is completed.

  6. Now comes one of the most important steps: When you're done with the tutorial, remove all your code and start over. Try to build the app again, but this time on your own. Just do your best, and only refer back to the tutorial when you get stuck.

  7. Keep doing this until you can literally build the whole app from scratch, by yourself. I know it sounds boring, but you'll learn so much by writing the same code over and over until you really understand what each part is doing.

  8. Go back to step 3. Find a different tutorial / project and repeat. ​

This process is literally what transformed me from "JavaScript is kinda cool, but I don't really get it" to "I can comfortably build entire JavaScript projects by myself". It was a serious game changer, so I highly encourage you to give it a shot.

It can feel tedious and boring, but I promise you: repetition and building is how you'll actually learn.