0
我试图使用及arguments.length得到命名功能的长度与困惑的arguments.length:在名为Arrow功能
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
我真的很困惑