How are arguments a legit argument to Array.slice?
- From: lorlarz <lorlarz@xxxxxxxxx>
- Date: Thu, 28 Aug 2008 13:36:12 -0700 (PDT)
In the code sample below, how are arguments a legitimate
argument to Array.slice?
Function.prototype.bind = function(){
var fn = this, args = Array.prototype.slice.call(arguments), object =
args.shift();
return function(){
return fn.apply(object,
args.concat(Array.prototype.slice.call(arguments)));
};
};
var myObject = {};
function myFunction(){
return this == myObject;
}
myFunction.bind(myObject)();
.
- Follow-Ups:
- Prev by Date: Re: FAQ Topic - How do I trim whitespace - trim/trimRight/trimLeft (2008-08-28)
- Next by Date: Re: larger radio/checkbox or mapping?
- Previous by thread: Modify String.prototype?
- Next by thread: Re: How are arguments a legit argument to Array.slice?
- Index(es):