I haven\'t found any complete cross-browser doc of this variable.
What is arguments.callee for? how does it work?
Which arguments does it have?
It specifies the currently executing function, so arguments.callee is the current function. It may be helpfull if you need to go recursive in anonimous function. Here example from mozilla:
function create() {
return function(n) {
if (n <= 1)
return 1;
return n * arguments.callee(n - 1);
};
}
var result = create()(5); // returns 120 (5 * 4 * 3 * 2 * 1)