Last active
September 18, 2015 22:01
-
-
Save joepie91/48042173a6c9c4065399 to your computer and use it in GitHub Desktop.
Testing Promises/A+ compliance
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 pr = new Promise(function(resolve, reject) { | |
resolve("a"); | |
}) | |
pr.then(function(val) { | |
console.log(".then triggered"); | |
}) | |
console.log("after defining .then"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Correct output, for a Promises/A+ compliant implementation:
If the order is different, then the implementation is not A+ compliant, as the
.then
handlers are not guaranteed to be executed asynchronously.