title: Replace a one javascript object with another object
body: <p>On page load I am creating two Javascript Objects, <code>objDemo1</code> and <code>objDemo1Backup</code> where the latter is simply an exact copy of the first.</p>
  
  <p>e.g.</p>
  
  <pre><code>objDemo1 { 
      sub_1 = { something: 123, somethingElse: 321 },
      sub_2 = { something: 456, somethingElse: 654 }
  }
  </code></pre>
  
  <p>I can modify the values in <code>sub_</code> as well as add / delete new <code>sub_</code>'s but the only object I am editing is <code>objDemo1</code>. i.e. I never change <code>objDemo1Backup</code> </p>
  
  <p>I have a reset button that when clicked will reset <code>objDemo1</code> back to what it was when the page originally loaded (i.e. <code>objDemo1 = objDemo1Backup</code>). This is where I am having the issue..</p>
  
  <p><strong>How do I set <code>objDemo1</code> to <code>objDemo1Backup</code>?</strong></p>
  
  <p>I have tried:</p>
  
  <pre><code>objDemo1 = objDemo1Backup;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>objDemo1 = null;
  var objDemo1 = objDemo1Backup;
  </code></pre>
  
  <p>...as well as similar variations but nothing seems to work.
  Any ideas?</p>
  
  <ul>
  <li>Note: I can confirm that at the point of resetting, <code>objDemo1Backup</code> is exactly the same as it was when I created it and <code>objDemo1</code> has changed.</li>
  <li>My code is definetly hitting the "reset" functionality, where I've tried the <code>objDemo1 = objDemo1Backup</code>... I just cannot figure out the syntax to replace the object.</li>
  </ul>