News for hackers. Stuff that matters.
Re:ES6: The features I'm most excited about by cjbprime on Sunday July 05, 2015 @10:31PM (#9836356)
> .then() does not create a new Promise

It returns a promise, right?

  > var foo = Promise.resolve([1,2,3]).then(function() { return 5 })
  > foo
  < Promise {[[PromiseStatus]]: "resolved", [[PromiseValue]]: 5}
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.
Re:ES6: The features I'm most excited about by DCoder on Monday July 06, 2015 @01:33AM (#9836988)
No, it returns a new Promise that's already been resolved to the value you returned previously.
Re:ES6: The features I'm most excited about by cjbprime on Monday July 06, 2015 @10:00AM (#9839087)
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)
Re:ES6: The features I'm most excited about by DCoder on Monday July 06, 2015 @10:37AM (#9839377)
Yes, you're right. My bad.