title: What's the difference between isPrototypeOf and instanceof in Javascript?
body: <p>In some of my own older code, I use the following:</p>
  
  <pre><code>Object.prototype.instanceOf = function( iface )
  {
   return iface.prototype.isPrototypeOf( this );
  };
  </code></pre>
  
  <p>Then I do (for example)</p>
  
  <pre><code>[].instanceOf( Array )
  </code></pre>
  
  <p>This works, but it seems the following would do the same:</p>
  
  <pre><code>[] instanceof Array
  </code></pre>
  
  <p>Now, surely this is only a very simple example. My question therefore is:</p>
  
  <p>Is <code>a instanceof b</code> <em>ALWAYS</em> the same as <code>b.prototype.isPrototypeOf(a)</code> ?</p>