ES6 Promises Explained Visually, With Code Examples

A new feature of ES6 to help with async programming.

syntax

new Promise(executor);
new Promise(function(resolve, reject) { ... });

MDN image