title: prototype of function in JS?
body: <p>See the code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function A(){
      
  }
  var x = new A();
  console.log(x.attr);  // undefined
  A.prototype.attr = 1; 
  console.log(x.attr); // 1</code></pre>
  </div>
  </div>
  </p>
  
  <p>The memory is allocated, when we invoke <code>new A()</code>, and x don't have property <code>attr</code>, but after <code>A.prototype.attr = 1;</code> is executed, x has property <code>attr</code>.
  Does it mean <code>x</code> is reallocated? </p>