title: Deep clone class instance JavaScript
body: <p>I'm trying to figure out a way to deep clone a JS class instance while preserving all the prototypes down the chain.</p>
  <p>I've seen how to deep clone an object:</p>
  <pre><code>JSON.parse(JSON.stringify(instance))
  </code></pre>
  <p>And I have seen how to make a shallow copy of a class instance:</p>
  <pre><code>Object.assign( Object.create( Object.getPrototypeOf(instance) ), instance)
  </code></pre>
  <p>But my question is, is there a way to deep clone an instance of a class?</p>