Eg:
function A(){} function B(){} B.prototype = new A();
How can I check if the class B inherits class A?
You can test direct inheritance with
B.prototype.constructor === A
To test indirect inheritance, you may use:
B.prototype instanceof A
(this second solution was first given by Nirvana Tikku)