arguments.callee
Inside a Javascript function, the arguments keyword has a property callee that refers to itself. You can use this in anonymous functions to recursively call itself, or when removing event listeners.
Recursive:
function() {
try {
// Do something that might throw an error
} catch (error) {
setTimeout(arguments.callee, 0);
return;
}
}
Removing event handlers:
document.attachEvent("onreadystatechange", function(){
if (document.readyState === "complete") {
document.detachEvent("onreadystatechange", arguments.callee);
}
});