The Websites I Use to Learn Modern JavaScript
By: Matthew Macdonald
Tags: Ecmascript, Programming, Es2020, JavaScript, Web Development

The web is drowning in outdated JavaScript advice. You probably already knew this. I certainly did. But I didn’t really grasp the size of the problem until I started to dig into some old code.

Recently, I’ve been helping to update an old (but classic) JavaScript book from tech publisher O’Reilly. On the way, I’ve been researching corners of JavaScript that I haven’t touched in a while. And I’ve come across plenty of awful advice.

The problem isn’t clickbait. (It’s pretty easy to spot when a writer is more interested in getting you to scroll past a few ads than to share some genuine insight.) The problem is old content that no longer represents best practices. And the search ranking of this content is often surprisingly high. If you aren’t specifically looking for a hot new feature that was introduced with one of the last few ECMAScript releases, the sheer weight of old information often overwhelms newer and more relevant content.

To be clear, I’m not talking about relatively minor points (like you should use let instead of var to prevent weird edge cases with variable hoisting). These are relevant issues, but not critical. I’m talking about major patterns that have shifted over the past decade. Things like associative arrays or modules. For example, it’s easier to find articles touting the basically obsolete revealing module pattern than to learn about one of the modern approaches, like Node or the official ES6 module standard. And the problem is made worse by the way new developers often write new blog entries to rehash old advice (a practice encouraged by coding camps). I came across old, roll-your-own module system advice from articles like this written as recently as 2019(!)

It’s the-emperor-has-no-clothes level bad.

There’s no obvious fix for old information about a quickly evolving language with a long and dirty history. Which got me thinking about something I could do — share my personal go-to resources. These are the websites I use to research the JavaScript features I don’t know as well, or to check up and see if anything’s changed with the features I do know. So far, none of these resources has let me down with old techniques or recycled advice.

The Mozilla Developer Network

Most developers are familiar with the reference portion of the MDN, where you can find complete catalogs of CSS properties and DOM objects. But the MDN also has a sprawling catalog of extremely useful material explaining new JavaScript features.

If you’ve been away from JavaScript for a while (or your expertise lies in other languages), their classic Re-introduction to JavaScript is a perfect starting point. It’s a surprisingly comprehensive and doesn’t hesitate to go deep.

Another high point is the JavaScript API page, which acts as an index to all the supplemental standards that fall under the umbrella of modern JavaScript but aren’t actually part of the language — things like web workers and geolocation.

There are two potential problems with the MDN. First, there’s a vast chasm between its introductory walkthroughs and its detailed references. I doubt a beginner could work there way through the whole language here. Second, the Mozilla company is struggling. They’ve cut their docs team, and the MDN may not be able to maintain its historical high level of quality. But that remains to be seen.

Eloquent JavaScript

I love programming books (free or otherwise), but they aren’t usually my first stop for keeping up with a fast-changing language. The problem is that writing even a small book is an enormous task. If you’re motivated, enthusiasm might see you through the first edition, but you have to be really motivated to revisit the same book over and over again to keep it up to date. And it doesn’t help that most programmers are busy with much more lucrative work.

Eloquent JavaScript, now in its third edition, has defied the odds so far. It’s a smart, lean JavaScript tutorial that exists as an in-print book from No Starch Press, and a free, nicely formatted web version.

Eloquent JavaScript is easily the most enjoyable read in this list. And there are so many useful insights that you won’t be bored, even if you’re reading one of more basic chapters. It’s not a comprehensive reference (so don’t expect to learn everything there is to know about new JavaScript standards). But it does a lot to orient you to the mindset of modern JavaScript programming.

The Modern JavaScript Tutorial

There are several dozen JavaScript tutorial sites that look mostly the same as this plainly styled Modern JavaScript Tutorial. Maybe that’s why I had low expectations when I first discovered it years ago.

Fortunately, I was wrong. The Modern JavaScript tutorial is exactly what it says it is — a compact guide to the latest JavaScript language features and practices. And behind its boring formatting is a hint of dry wit. I especially enjoy no-nonsense remarks like “The information in this article is useful for understanding old scripts. That’s not how we write code now.” (For example, when talking about immediately-invoked function expressions.)

Somehow, despite being a decade old, The Modern JavaScript tutorial stays tight and focused. Old content is tossed out and revamped ruthlessly. Follow the github repo and you’ll see that it’s updated every few days. Its 11K stars are well earned.

Honorable mentions

Before I wrap up, here are a few more resources that have given me some useful advice, even though I don’t turn to them as often.

JavaScript Enlightenment is a better-than-decent free site that concentrates on features that have been added to JavaScript from ES2015 on. Ages ago, it was an O’Reilly book, but now the book is years out of date while the vastly transformed web version lives on. If you want a way to focus just on JavaScript’s most recent features, it’s a solid overview.

JavaScript for Impatient Programmers is a detailed look that takes you deep into the bowels of the language. At times, you might feel like you’re reading an easier-to-understand version of the official ECMAScript specs. And weighing in at over 500 pages, it’s questionable whether an impatient programmer could make it very far in this oddly named online book. But it’s hard to browse its pages without learning at least something new.

The Airbnb JavaScript Style Guide won’t teach you JavaScript but it will help you write clean and consistent code. After all, JavaScript coding practices can be as loose as the Wild West. How do you impose order on your codebase? You can (and should) use a linting tool like ESLint, but that’s only going to catch outright rule violations. If you’re looking for a prescriptive style guide, and your company doesn’t have a formal document of its own, this the most thorough public reference that I’ve found.