[quote]function Foobar(foo, bar){
return Array.prototype.slice.call(arguments);
}
alert(Foobar("I am foo", "I am bar"));[/quote]
Unless you want them as an array from the function definition.
[quote]Object.defineProperty(Function.prototype, "Args", {
get: function(){
return /function [^\(]*\((.*)\)/i.exec(this.toString())[1].split(/\s*,\s*/);
}
});
var foobarArgs = Foobar.Args;[/quote]