Can someone explain why this prints in reverse order?
Code:
when('test')
.then(function() {console.log('should be first');})
.then(console.log('should be second'));
Output:
should be second
should be first
PS: I am using when.js version: [email protected]
You're immediately executing the second
console.log
, and passing the return value tothen
. You need to pass functions tothen
.You've effectively done this: