Eg:
function A(){} function B(){} B.prototype = new A();
How can I check if the class B inherits class A?
I do not think Simon meant B.prototype = new A() in his question, because this is certainly not the way to chain prototypes in JavaScript.
B.prototype = new A()
Assuming B extends A, use Object.prototype.isPrototypeOf.call(A.prototype, B.prototype)
Object.prototype.isPrototypeOf.call(A.prototype, B.prototype)