Function.prototype.bind

Garrett Smith dhtmlkitchen at gmail.com
Wed Sep 10 16:59:55 PDT 2008


On Wed, Sep 10, 2008 at 3:41 PM, David-Sarah Hopwood
<david.hopwood at industrial-designers.co.uk> wrote:
> Mark S. Miller wrote:
>> On Tue, Sep 9, 2008 at 9:51 PM, Brendan Eich <brendan at mozilla.org> wrote:


>
> This can be fixed by either renaming Function.apply, or conditioning
> on whether there are two or three arguments (the former is more elegant).
> The important point is the need for a static 3-argument version of
> 'apply', not what it is called. I will suggest the name 'apply3' as
> a starting point (for symmetry and convenience 'call3' should also be
> provided).
>

Why would "Function.apply3" need three arguments?

Function.prototype.apply doesn't actually need any arguments.

See for yourself:-

function fun(){ alert(42); }
Function.prototype.apply.call(fun);

> --
> David-Sarah Hopwood


More information about the Es-discuss mailing list