|Property/method value type:||Function result|
|Argument list:||anArray||A set of arguments presented as an array|
|anObject||An object to apply the function to|
If you want to force a particular function implementation to be used on an object, you can locate the one you want and pass it an object on which to operate. The function then executes as if it were a property of the passed object instead of the receiving object.
This can be useful to restore some functionality that may have been overridden or to share a function definition between several objects.
This is effectively like adding the function as a property to the target object, executing it, passing the arguments to it and then deleting the function property afterwards. Applying a function is a lot easier.
This is similar to the call() method that passed the arguments as a comma separated list. This passes them as an array.
// Use the fundamental valueOf method on an object that has overridden // its own valueOf method Object.prototype.valueOf.apply(myTargetObject);