Created
March 2, 2015 08:17
-
-
Save aisk/5a44d8d35f17030c9740 to your computer and use it in GitHub Desktop.
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
var p1 = new Promise(function(resolve, reject) { | |
setTimeout(function() { | |
resolve(1); | |
}, 2); | |
}); | |
var p2 = new Promise(function(resolve, reject) { | |
setTimeout(function() { | |
reject(1); | |
}, 1); | |
}); | |
var all = Promise.all([p1, p2]); | |
all.then(function() { | |
console.log('ok', arguments); | |
}, function() { | |
console.log('err', arguments); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment