So the question is pretty straight forward - should .then
return last promise inside the body of the function?
For example:
Promise.resolve().then(function() {
Promise.resolve(1)
Promise.resolve(2)
}).then(function(val) {
return val;
})
Should it return last value (2) when promise resolves?
I'm working with some legacy code and this construction is pretty common among some modules, but it doesn't work.