JavaScript

Why JavaScript? JavaScript is a wonderful language. It is incredibly flexible, dynamic, and expressive. This page is going to attempt to be a collection of the best resources on core JavaScript stuff from the basics to the bleeding edge, with some material original to this wiki in the middle.

The best reference for JS and related technologies by far is the Mozilla Developer Network , I am constantly looking stuff up there. And here is a good cheat sheet to reference while you're getting started.

If you are new to JavaScript this is where to start, basic syntax and ideas. The first few links are even good if you are completely new to programming. You may notice some radically different styles and best practices supported by these authors, at this point it's good to keep an open mind and try everything. We'll worry about how that stuff works for you later.

These resources are all about writing code that is less likely to have bugs through using a consistent style and avoiding practices that lead to confusing or hard to debug code. The problem is that this is all subjective material, and a giant bike shed for anyone who feels like arguing about it.

This is the content that originated here and not a set of links. It attempts to answer in detail the question "What state does my function have access to when it's invoked?" This turns out to be a complex question, leading to a lot of unexpected behavior. This section will hopefully remove a lot of surprises, allowing us to understand higher level abstractions that rely on these concepts.

This is a short list of common pitfalls in JavaScript, and some simple solutions for them. A lot of these problems arise from the deeply asynchronous nature of the language and may be applicable to other similar environments. Others are unique to JavaScript's attempts to be beginner friendly, and attempting to do something sensible given ambiguous input. Example code is also on GitHub here .

These resources build on the rest of our knowledge to create expressive, reusable, easy to interact with code.