JavaScript Arrow functions as a constructor


Example

Arrow functions will throw a TypeError when used with the new keyword.

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

const a = new foo();

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

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