I was trying to get the length of a named function using the arguments.length:
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
but when I tried to use named arrow function:
let a = (b,c) => {
console.log(arguments.length);
};
a(1,2); //ReferenceError: arguments is not defined
and this:
((b,c) => {
console.log(arguments.length);
})(1,2); //ReferenceError: arguments is not defined
I'm really confused now