title: Change the type of an object after it has been created
body: <p>Just out of curiosity, and to make a little experiment I have in mind, is it possible to change the type of an object after it's been created?</p>
  
  <p>By changing it's type I mean to make the object respond to the instanceof operator, like this:</p>
  
  <p>(as you can see, I tried changing the constructor, but it didn't work)</p>
  
  <pre><code>var MyConstructor = function() { this.name = 'no name' };
  undefined
  
  var myInstance = { name: 'some name' }
  undefined
  
  myInstance instanceof Object
  true
  
  myInstance instanceof MyConstructor
  false
  
  myInstance.constructor
  function Object() { [native code] }
  
  myInstance.constructor = MyConstructor
  function () { this.name = 'no name' }
  
  myInstance instanceof Object
  true
  
  myInstance instanceof MyConstructor
  false
  </code></pre>
  
  <p>I guess I could create a new object with new MyConstructor(), and then delete every property from it and then copy every property from myInstance, but was wondering if there exists a simpler way...</p>
  
  <p>-- UPDATE --</p>
  
  <p>I do know the existence of the <code>__proto__</code> property, I just discarded it upfront because I know that event though it's implemented in most browsers is not part of the standard.</p>