Promise() vs. new Promise()

Allen Wirfs-Brock allen at
Thu Aug 21 09:28:21 PDT 2014

On Aug 20, 2014, at 7:30 PM, Andrea Giammarchi wrote:

> I like the `` hint but unless it's an implicitly
> self bound method you still cannot easily pass it around as callback
> for a map without binding it all over.
> `` without needing to explicitly bind it each time
> is needed/used would be an exception, but probably a good one.

true, but you can write:>new Map(...a));

or define:

Object.assign(Function.prototype, {
   get asFactory() {return (...args)=>new this(...args)}

so you can say:


More information about the es-discuss mailing list