Hello everybody.

The currently proposed bind() method for function objects behaves like
call(): it takes a number of arguments (from arguments[1] onwards), and
uses them for the function execution.

Wouldn't it be more flexible to behave like apply(), taking an array of
parameters instead of taking each parameter individually ?

The second approach seems more powerful to me. That is, every call() can
easyly be replaced by apply():
 func.call( thisObj, a, b, c ) -> func.apply( thisObj, [ a, b, c ] )

...But when you only have got an array of arguments, you can't go the
other way around:
 func.apply( thisObj, argsArray ) -> func.call( /* impossible */ )

Would it be possible to change bind to behave like apply ?

Regards,

Jordan OSETE




_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to