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
