js copy element from 1 array to an ob code example
Example 1: js clone array
var clone = myArray.slice(0);
Example 2: js deep copy array
const numbers = [1, [2], [3, [4]], 5];
// Using JavaScript
JSON.parse(JSON.stringify(numbers));
// Using Lodash
_.cloneDeep(numbers);