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