function anyoldname(x1,x2) { |
var argv = anyoldname.arguments; |
n = anyoldname.arguments.length; // number of arguments -- same as argv.length |
var y1 = anyoldname.arguments[0]; // y1 is same as this.x1 or argv[0] |
var yn = anyoldname.arguments[n-1]; // last argument -- same as argv[n-1] |
var wherefrom = anyoldname.caller; // use inside function to find where called from |
} |
This allows one to find number of arguments when called and process functions with variable number of arguments |
Netscape documentation says this is a property of Functions (interpreted functions) but appears to work on both! |