Created
November 3, 2016 21:39
-
-
Save octopuss/697a8c839a254559045cd41a65978e74 to your computer and use it in GitHub Desktop.
Promises alternative to async await http://www.es6fiddle.net/iv2vj8jm/
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
console.log("First"); | |
var p = new Promise((ok, reject) => { | |
try { | |
console.log("Second"); | |
ok(); | |
} catch (err) { | |
reject(); | |
} | |
}); | |
p.then(() => {console.log("Fourth")}) | |
console.log("Third"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment