# Sultan (5 months ago)

Was there any reason Promise.resolve was not afforded the ability to dispatch outside of this pointing to the Promise constructor?

For example:

const {resolve} = Promise resolve(1234)

This currently throws.

# Logan Smyth (5 months ago)

Promise can be subclassed, so the this context for resolve affects what class is instantiated.

# Michał Wadas (5 months ago)

This is not valid answer. Arrays can be subclassed too, but (1,Array.of)(2,3 ) returns instance of Array.

# Augusto Moura (5 months ago)

It is the valid answer, subclassing is the reason behind the design choice of Promise static members depending on this. If it was a good decision or not is another topic. Array.of was designed in a different occasion and static methods inheritance was not a subject at the time

Em dom, 3 de fev de 2019 22:04, Michał Wadas <michalwadas at escreveu:

# medikoo (5 months ago)

You'll find a solid explanantion here: tc39/ecma262#544

Array.from, Array.of were designed in very early stage of ES2015, and fact that they work that way (while e.g. Promise.resolve does not), is now considered a mistake that was too late to revert at some point.

-- Sent from: