Creating a deep copy with structuredClone The modern way to deep copy an array in JavaScript is to use structuredClone: array2 = structuredClone(array1); This function is relatively new (Chrome 98, Firefox 94) and is currently available to about 95% of users, so may not ready for production without a polyfill. As an alternative, you can use one of the well-supported JSON-based solutions below. Cre
![How do you clone an array of objects in JavaScript?](https://cdn-ak-scissors.b.st-hatena.com/image/square/98d6f053a97a87156775f60757c60865d0f2c47d/height=288;version=1;width=512/https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fstackoverflow%2FImg%2Fapple-touch-icon%402.png%3Fv%3D73d79a89bded)