title: Javascript instanceof doesn't work as my expectation
body: <p>I am learning javascript and wrote below code.</p>
  
  <pre><code>var Parent = (function() { return function() {};})();
  var Child = (
      function() { 
          return function(p) {
              var F = new Function();
              F.prototype = p.prototype;
              Child.prototype = new F();
          };
      })();
  
  var p = new Parent();
  var c = new Child(Parent);
  console.log(p instanceof Parent);
  console.log(c instanceof Parent);
  </code></pre>
  
  <p>c instanceof Parent returns false, which doesn't match my expectation!!</p>
  
  <p>Then I change the code to:</p>
  
  <pre><code>var Parent = (function() { return function() {};})();
  var Child = (function() { return function() {};})();
  var F = new Function();
  F.prototype = Parent.prototype;
  Child.prototype = new F();
  var p = new Parent();
  var c = new Child();
  console.log(p instanceof Parent);
  console.log(c instanceof Parent);
  </code></pre>
  
  <p>This time c instanceof Parent returns true.
  Who can answer why?</p>