P
Peter Michaux
There seem to be some options for converting the arguments object
inside a function to an instance of Array. I'm curious if anyone has
encountered any problems with any particular techniques for this
From <URL: http://groups.google.com/group/comp.lang.javascript/msg/98c27152ea5c7d55?dmode=source>
var args = [].slice.call(arguments,1);
var args = Array.prototype.slice.call(arguments, 1);
I've tried the following which is short and it seems to work in NN4.08
and O5.02. (I can't seem to keep a stable IE5.5. grrr.)
Array.apply([], arguments)
Thanks,
Peter
inside a function to an instance of Array. I'm curious if anyone has
encountered any problems with any particular techniques for this
From <URL: http://groups.google.com/group/comp.lang.javascript/msg/98c27152ea5c7d55?dmode=source>
var args = [].slice.call(arguments,1);
var args = Array.prototype.slice.call(arguments, 1);
I've tried the following which is short and it seems to work in NN4.08
and O5.02. (I can't seem to keep a stable IE5.5. grrr.)
Array.apply([], arguments)
Thanks,
Peter