js clone array of elements code example
Example 1: javascript duplicate an array
let arr =["a","b","c"];
// ES6 way
const duplicate = [...arr];
// older method
const duplicate = Array.from(arr);
Example 2: js copy array into another
var destinationArray = Array.from(sourceArray);