Created
December 17, 2017 02:32
-
-
Save AshyIsMe/652da1a7b34a0ce1507a8e7055066eeb to your computer and use it in GitHub Desktop.
This file contains 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
$ node test_promises.js | |
exiting you focker! | |
Meaning of life: 42 | |
This file contains 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
var p = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve(42); | |
}, 1000); | |
}); | |
p.then((life) => { | |
console.log("Meaning of life: ", life); | |
}); | |
console.log("exiting you focker!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment