title: Check if "instanceof" is going to fail
body: <pre><code>function A(){}
  A.prototype = "Foo bar";
  
  new A() instanceof A;
  // TypeError: Function has non-object prototype 'Foo bar' in instanceof check
  </code></pre>
  
  <p>As you can see, if the prototype of a constructor is not an object, it will fail and throw an error. Is there a way to make sure <code>instanceof</code> will not fail?</p>
  
  <pre><code>typeof new A().constructor.prototype === "object"
  </code></pre>
  
  <p>and </p>
  
  <pre><code>typeof Object.getPrototypeOf(new A()) === "object"
  </code></pre>
  
  <p>apparently do not work.</p>