Skip to content

Instantly share code, notes, and snippets.

Created June 20, 2013 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5823503 to your computer and use it in GitHub Desktop.
Save anonymous/5823503 to your computer and use it in GitHub Desktop.
$.when($.Deferred().resolve(2), $.Deferred().resolve(4))
.then(function(a,b) {
console.log(a,b)
}).then(function(a,b) {
console.log(a,b)
});
// prints "2 4" and then "undefined undefined"
$.when($.Deferred().resolve(2), $.Deferred().resolve(4))
.done(function(a,b) {
console.log(a,b)
}).then(function(a,b) {
console.log(a,b)
});
// prints "2 4" and then "2 4", as expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment