Async Programming for the Lazy

You're probably here because you heard that async is hard.

Why Async is Not Hard | Async 101

So, here's the deal. You want to learn async. But, let's face it, it's a pain in the neck.

Here's a cheat sheet for when you just need a quick reminder.

Key Terms

Code Examples

These are some examples of async code. Don't try this at home, kids.

// Async Example 1: Callbacks are fun
var callback = function() { console.log('callback'); };
setTimeout(callback, 1000); // 1000ms = 1 second
// Async Example 2: Promises are fun
var promise = new Promise(function(resolve) { resolve('resolved'); });
promise.then(function(result) { console.log(result); });
More Callbacks | More Promises

And, that's it. That's all you need to know. Now, go forth and be async.

Async Advanced