I\'m trying to learn how to use promises, but am having trouble comprehending the chaining. I assume that with this code, both promises will run. Then when I call test.then(
You need to return next promise from the then callback:
then
test.then(function(data) { console.log(data); return test2; }).then(function(data) { console.log(data); });