Why was the arguments.callee.caller
property deprecated in JavaScript?
It was added and then deprecated in JavaScript, but it was omitted altogether by
It is better to use named functions than arguments.callee:
function foo () {
... foo() ...
}
is better than
function () {
... arguments.callee() ...
}
The named function will have access to its caller through the caller property:
function foo () {
alert(foo.caller);
}
which is better than
function foo () {
alert(arguments.callee.caller);
}
The deprecation is due to current ECMAScript design principles.