Skip to content

Instantly share code, notes, and snippets.

@jpina
Created November 25, 2015 11:04
Show Gist options
  • Save jpina/1304a135cfea147a2014 to your computer and use it in GitHub Desktop.
Save jpina/1304a135cfea147a2014 to your computer and use it in GitHub Desktop.
02 How to use a promise
promise.then(function(result) {
console.log(result); // "Stuff worked!"
}, function(err) {
console.log(err); // Error: "It broke"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment