Re: [whatwg] How works Promise.any() if it was called with resolved promises?

On Fri, Jun 14, 2013 at 2:25 PM, Tetsuharu OHZEKI
<saneyuki.snyk@gmail.com> wrote:
> I have questions about DOM Promise.
>
> If we call `Promises.any()` with resolved promises, how does it
> execute its fulfillCallback?

The returned promise is immediately fulfilled, so the callback will be
called in the next tick.

Remember, the whole point of promises is that you can add new
callbacks before *or* after the promise is resolved, and it'll work
either way.

~TJ

Received on Friday, 14 June 2013 14:32:54 UTC