var length = 10;
function fn(){
alert(this.length);
bracket
var obj = {
length:5,
method:function( fn /* , a */ ){
fn();
arguments[0]();
// this.method.arguments[0]();
// console.dir(arguments);
// console.dir(this.method.length);
// console.dir(arguments.length);
bracket
bracket
obj.method(fn);
The first pop-up 10 should be well understood, the second pop-up 1
Arguments is not an array, you can see it by printing it.
Arguments[0] This 0 is equivalent to an attribute of arguments, which is the same as obj[attrName]
Arguments[0] () just like calling obj[attrName], this in fn points to arguments
In this way, we can understand why the latter is 1