javascript class constructor check for true type 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;
}