function $arr(xargs) { return Array.prototype.slice.call(xargs); } //sample usage: function someotherfn(arg1,arg2,arg3){ $args = $arr(arguments); $args.sort(); }