title: JavaScript multiple inheritance and instanceof
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7373644/javascript-multiple-inheritance">Javascript multiple inheritance</a>  </p>
  </blockquote>
  
  
  
  <p>Is there a way in JavaScript to do this:</p>
  
  <pre><code>Foo = function() {
  
  };
  
  Bar = function() {
  
  };
  
  Baz = function() {
      Foo.call(this);
      Bar.call(this);
  };
  
  Baz.prototype = Object.create(Foo.prototype, Bar.prototype);
  
  var b = new Baz();
  console.log(b);
  console.log(b instanceof Foo);
  console.log(b instanceof Bar);
  console.log(b instanceof Baz);
  </code></pre>
  
  <p>So that Baz is both an instance of Foo and Bar?</p>