Last active
February 1, 2017 09:39
-
-
Save spences10/71bf1767a50d8301b9a225cdcff53a23 to your computer and use it in GitHub Desktop.
Promise example from Kyle Robinson Young, https://github.com/shama/letswritecode/blob/master/async-js-with-promises/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creating promises | |
var promise = new Promise(function (resolve, reject) { | |
resolve('all good') | |
}) | |
promise.then(function (result) { | |
console.log('was it good?', result) | |
}).catch(function (err) { | |
console.error('ERR', err) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment