Javascript 与命名箭头函数中的arguments.length混淆

Javascript 与命名箭头函数中的arguments.length混淆,javascript,ecmascript-6,arguments,arrow-functions,Javascript,Ecmascript 6,Arguments,Arrow Functions,我试图使用参数获取命名函数的长度。长度: var a = function(b,c){ console.log(arguments.length); }; a(1,2); //2 (this is what I'm expecting) (function(b,c){ console.log(arguments.length); })(1,2); //it returns 2 also (b,c) => { console.log(arguments.length); }; (1,

我试图使用参数获取命名函数的长度。长度:

var a = function(b,c){
console.log(arguments.length);
};
a(1,2); //2 (this is what I'm expecting)


(function(b,c){
console.log(arguments.length);
})(1,2); //it returns 2 also


(b,c) => {
console.log(arguments.length);
};
(1,2); //2 also
但是当我尝试使用命名箭头函数时:

let a = (b,c) => {
console.log(arguments.length);
};
a(1,2); //ReferenceError: arguments is not defined
这是:

((b,c) => {
console.log(arguments.length);
})(1,2); //ReferenceError: arguments is not defined
我现在真的很困惑

你的第一次测试完全错了;表达式
(1,2)
的返回值是
2
,但这仅仅是因为
2
运算符的最后一个操作数,而不是因为
参数。length
。该示例中甚至没有调用“匿名箭头函数”