Error first Callbacks

Error first Callbacks are functions that do not return any value, but have a last parameter that take a function with two parameters. The first paramater is usually some sort of error, while the second parameter is the data that would have been normally returned in a Synchronous function.

Generators

Generators can yield many results without have to complete execution until all of the data has been delivered. These function can be identified by having * between the function keyword and function name as shown in the example below.

Promises

Promises are a special object asynchornous type that are a kind of monad. Promises use a constructor that take a callback with a resolve and reject parameters. Errors are passed into the reject function callback, and succesful results are passed back through the resolve callback.

Async/Await

The async and await keywords were added as part of the es2017 language specification. Any function can be turned into a promise by adding the async keyword to the beginning of the function. Any thenable promise can be resolved inside of that async function by placing the await keyword in front of the promise.