考察点:箭头函数的 this 词法绑定、缺少 prototype/arguments、构造函数限制,以及「何时不该用箭头函数」。这是 this 追问链的关键一环。
要点:
[[Construct]] 内部方法,new 箭头函数() 直接抛 TypeError;因此它也没有 prototype 属性,不能挂方法到 .prototype。...args;也没有自己的 super、new.target。this 指向「调用者」(如事件回调 el.onclick = () => this...、被 obj.method() 形式调用、类原型方法需要访问实例)时,箭头函数会错误捕获外层 this;这类场景应写普通函数。一句话记忆:箭头函数适合「短小的、不需要自己 this 的回调」(map/filter/定时器),不适合「需要动态 this 的方法、构造函数」。
题目与答案就在本页;收藏、批注和错题重练在应用内