JS isPrototypeOf
by Town
JavaScript
function A() {}
function B() {}
B.prototype = Object.create(A.prototype);
var a = new A();
var b = new B();
console.log("b is prototype of a", b.isPrototypeOf(a)); // false
console.log("a is prototype of b", a.isPrototypeOf(b)); // false
console.log("b is prototype of A", b.isPrototypeOf(A)); // false
console.log("A is prototype of b", A.isPrototypeOf(b)); // false
console.log("A prototype is prototype of b", A.prototype.isPrototypeOf(b)); // true
console.log("b prototype is prototype of A", b.prototype.isPrototypeOf(A)); // syntax error