Re:ES6: The features I'm most excited about
by rory096 on Sunday July 05, 2015 @11:09PM
(#9836511)
I'd think it would return the original promise, for chaining.
[ Parent
| on HN ]
No, it returns a new Promise that's already been resolved to the value you returned previously.
Not quite :) See my paste above, it returns a new Promise in pending state that will return the value in the new then block ("5" here), possibly immediately. (i.e. pending for one event loop tick, then resolved)