clone array without modifying code example
Example 1: angular clone array without reference
const myClonedArray = Object.assign([], myArray);
Example 2: angular clone array without reference
const myClonedObject = Object.assign({}, myObject);
const myClonedArray = Object.assign([], myArray);
const myClonedObject = Object.assign({}, myObject);