@@iterator in arguments object

Brandon Benvie brandon at brandonbenvie.com
Sun Dec 23 11:28:51 PST 2012


Something like this?

var partial = (fn, ...args) => function(...newArgs){
  return fn.apply(this, args.concat(newArgs));
};


On Sun, Dec 23, 2012 at 2:26 PM, Wes Garland <wes at page.ca> wrote:

> Arguments object is used here to fill the rest void, but also as an
> argument to apply (after converting into a real array) when writing wrapper
> functions; eg monkey patches, userspace profiling, etc.
>
> Is there an ES6 way to use apply on rest params? If not, arguments must
> live on.
>
> Sent from my iPhone
>
> On 2012-12-23, at 12:48, Brandon Benvie <brandon at brandonbenvie.com> wrote:
>
> Yeah good point, and you don't even need to dump all the named params. In
> light of this, I think its feasible to pronounce the arguments object in
> ES6 as vestigial and ready for retirement (except for all the legacy code
> of course). ES6 claims another victim: [object Arguments].
>
> On Sunday, December 23, 2012, Brendan Eich wrote:
>>
>> You could always use an explicit rest parameter as the only formal
>> parameter and still dispense with arguments in new code.
>>
>
>
>
> _______________________________________________
>
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121223/4d9215d6/attachment.html>


More information about the es-discuss mailing list