I noticed not all the Javascript functions are constructors.
var obj = Function.prototype; console.log(typeof obj === \'function\'); //true obj(); //OK new
If the function is a constructor then it will have a "prototype" member which in turn has a "constructor" member that is equal to the function itself.
function isConstructor(func) { return (func && typeof func === "function" && func.prototype && func.prototype.constructor) === func; }