As of ES5, apply doesn't require its 2nd arg to be a "real array". An arguments 
object works fine there.

Brendan Eich <[email protected]> wrote:

>Wes Garland 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?
>
>A rest parameter is a real Array instance. Function.prototype.apply 
>works on array instances. What's the problem?
>
>/be
>
>> If not, arguments must live on.
>>
>> Sent from my iPhone
>>
>> On 2012-12-23, at 12:48, Brandon Benvie <[email protected] 
>> <mailto:[email protected]>> 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
>>> [email protected] <mailto:[email protected]>
>>> https://mail.mozilla.org/listinfo/es-discuss
>_______________________________________________
>es-discuss mailing list
>[email protected]
>https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to