brite, a MVC Framework for jQuery

JavaScript: arguments to Array

April 28th, 2011 by jeremychone

The arguments variable is not a true array, so, to convert it to an array to pass them to another method, here it is.

function hello() {
    var args = Array.prototype.slice.call(arguments);
    myOtherFunction.apply(this,args);

}

Comments are closed.