title: How to make a deep copy of a object in Javascript
body: <p>I want to make a deep copy of a object, say I have a object:</p>
  <pre><code>const oriObj = {
    id: 1,
    version: 1,
    person: 'jack'
  };
  </code></pre>
  <p>so after a <code>click event</code>, <code>oriObj</code> is set to be a empty array <code>[]</code>, but I still want to get the original value in the <code>oriObj</code> for example the id and version. I was trying to make a deep copy, so the no matter how <code>oriObj</code> is changing, once I am getting the value of oriObj in the beginning, I deep copy it and store in so it won't become empty array. I have tried several method, but it won't work, I am still getting empty array after the click event.</p>