title: Swap two objects in JavaScript
body: <p>I have the following code:</p>
  
  <pre><code>MyObject.prototype.doIt = function()
  {
       var a = this.obj1;
       var b = this.obj2; 
  }
  </code></pre>
  
  <p>How can i swap the values of <strong>this.obj1</strong> and <strong>this.obj2</strong> so obj1 becomes obj2 and obj2 becomes obj1.</p>
  
  <p><strong>!Note: Have in mind that i am not working with primitive types.</strong></p>