Arrow functions as a constructor
suggest changeArrow 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
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents