About Deep Copying of an Array

To create a deep copy of an Array in JavaScript, convert it to JSON and then parse it back:

1
let copy = JSON.parse(JSON.stringify(arr));

Deep copies are those where each key of an array points to a copy of the original value, but not to the original value itself.

Tips and Tricks Programming JavaScript