// 1.declare a function
function F(){}
F.prototype = null;
F.__proto__ = null;
var f = new F();//successful
console.log(f);
// 2.function assignment expression
var F2 = function (){}
F2.prototype = null;
F2.__proto__ = null;
var f2 = new F2();//successful
console.log(f2);
// 3.anonymous function
var F3 = (()=>{})
console.log(typeof F3);//"function"
var f3 = new F3();//Uncaught TypeError TypeError: F3 is not a constructor
I'm new to JS and I'm learning it's grammar in nodejs.
The three ways to create functions and new a object by the function are listed above.
prototype or __proto__ appears to be not affecting new a object , so I can assign them to null.
I'm curious why the anonymous function can not be used behind new, can I assign some properties to the anonymous function to make it support new ?