箭头函数不是没有 arguments ,而是没有自己的 arguments ;
function foo() {
setTimeout(() => {
console.log("args:", arguments);
}, 1);
}
foo(1, 2, 3, 4);
你会在箭头函数里得到 args: [1, 2, 3, 4],它来自于其父作用域。
并且连 this、super、new.target 都没有自己的,全都来自父作用域。
另外,在严格模式下也不允许使用 arguments