Arrow functions as a constructor

suggest change

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(); // TypeError: bar is not a constructor

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents