javascript check if function is a constructor code example
Example: js check if function is a constructor
function isConstructor(func) {
return (func && typeof func === "function" && func.prototype && func.prototype.constructor) === func;
}
function isConstructor(func) {
return (func && typeof func === "function" && func.prototype && func.prototype.constructor) === func;
}