Take a look at this code:
var args;
function foo(){
args = arguments;
}
foo();
console.log(args); // []
args.callee(); // foo
how come I'm not able to see any property or method of arguments object in console yet able to call callee method ?
You are not passing foo
any arguments. Also, The callee
property is "non-enumerable".
Disclaimer: this assumes you're using the Chrome or Firebug consoles, there is no standard, so custom consoles might do funky things.
Because you used console.log
which displays array-like* objects differently from "plain" objects. If you want to see the properties on the object, use console.dir
.
* to be array-like the object has to have a length
property and splice
function, or a number of other niche conditions.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.