Someone emailed me asking for tips or sites for learning JavaScript, and this is my final answer.

Warning, this is going to seem like “I believe I did, Bob”-style advice (ref:

But it’s really not. I really mean this, really and truly, from the bottom of my heart, as actual advice that I firmly believe will help people more efficiently and thoroughly than any other approach to learning JavaScript. My advice is this:

Read the ECMAScript specification.

Don’t feel like you have to understand every word. Give yourself permission to just force the words into your brain, and move on to the next section. If you’re diligent about it, it only takes a few hours. Repeat this process every few years.

I guarantee it will be an unpleasant experience if you’re not already experienced with reading language specifications. (As they go, this is a pretty good one, I’ve since learned.) It’s not fun reading. And it’s not like you’ll be able to sit down and suddenly grok the whole language like seeing the matrix or anything.

But I can also pretty much guarantee that you’ll be surprised what sticks. Weeks or months or years later, you’ll encounter some weird bug, or read a blog post, and go “OH! So THAT’S what that was talking about! Where was that? The part on function contexts or something?” and then you’ll be prepared to go look it up and get the exact details.

If you already know a bit of JavaScript, then reading the spec will be a bit less unpleasant, but parts will seem like you can skip them. Don’t skip those parts.

Programming requires a certain kind of precision, and a specification is a very precise thing. It’s tempting to think that learning must also follow a kind of precision, where you fully grok each concept before learning the next one, and follow a proper ordering of things.

But here’s the thing: humans aren’t precise. Learning is not like putting data into a computer because we aren’t computers and understanding isn’t information to be tokenized and stored. Understanding is more like a muscle than a memory, and learning is more like digestion than data entry. Let’s none of us be confused that digestion is anything but a process of turning nutrients into some combination of more you, mostly-wasted energy, and shit, and it’s not even remotely precise or ordered. And a language spec is like boiled kale with no salt, but it’s packed with nutritive understanding that will mostly be shat out of your brain or wasted in pointless hacker news threads, but some small part of it will make you strong and healthy.

So if you want to grow in the JavaScripts, you’ll never get there with candy-coated tutorials. Eat your fucking vegetables, and read the spec.

You’ll be glad you did.