title: How to create mutable AND immutable copy of object in JS
body: <p>Without using any additional libraries, how I can I create an immutable copy of an object and retain a mutable copy.</p>
  
  <pre><code>var mutableCopy = immutableData;
  
  Object.freeze(immutableData);
  
  mutableCopy.newProp = 'mutated!';
  
  console.log(mutableCopy.hasOwnProperty('newProp')); // false
  </code></pre>
  
  <p>It seems that <code>Object.freeze()</code> also freezes objects by reference.</p>
  
  <p><strong>How can I create a mutable and immutable copy of an object?</strong></p>