Are there any browser restrictions or any other issues that prevents me from doing:
fn.apply(this, arguments);
versus:
fn.apply(this, Array.prototype.slice.call(arguments));
I know that apply
takes a "true" Array
as second argument, but passing an arguments collection seems to work just as good. or...?
According to the MDN, it "Calls a function with a given this value and arguments provided as an array (or an array like object)". Given that arguments
is an array-like object, there shouldn't be any restriction on using it.
In fact, the description explicitly says arguments
is a valid parameter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With