Given two classes like so:
function A(name) {
this.name = name;
}
A.prototype.sayName = function() {
console.log(this.name);
}
var B = require('some-class');
// B is subclass of A?
Is there a way to programmatically determine if B is a subclass of A?
Edit: In my case, B is a function and B.prototype
extends A.prototype
. B is not the return of new A()
. B instanceof A
does not seem to work.