箭頭用作建構函式

當與 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...