js check if function is a constructor

JavaScript
function isConstructor(func) {
    return (func && typeof func === "function" && func.prototype && func.prototype.constructor) === func;
}
Source

Also in JavaScript: