Aug 7, 2023
Hi Glenn! Thanks for the message. Your example is only a shallow clone, so the nested array inside the object will still have the same pointer.
In the example from this article, I wrapped that shallow clone (your doppelganger) in JSON.parse and JSON.stringify to make a deep clone.
That piece of things wasn't clear, so I added a few more lines to clarify. Thanks for mentioning it!