title: How exactly does Javascript instanceof work? Is it slow style?
body: <p>How does the performance of <code>instanceof</code> fair for "huge libraries"?</p>
  
  <p>Does it travel up the prototype chain <strong>one by one</strong>, similar to this? : </p>
  
  <pre><code>//..
  var _ = john.constructor;
  while (true) {
      if (_ === Human) {
          return true;
      }
      _ = _.prototype.constructor
  }
  return false;
  //..
  </code></pre>
  
  <p>Is <code>instanceof</code> relatively unperfomant then, compared to storing a unique interface id number in the property of every object.</p>