箭头用作构造函数

当与 new 关键字一起使用时,箭头函数将抛出 TypeError。

const foo = function () {
  return 'foo';
}

const a = new foo();

const bar = () => {
  return 'bar';
}

const b = new bar(); // -> Uncaught TypeError: bar is not a constructor...