what you are trying to do seems to be creating a shallow copy of a JS array.
If this is not your use case, please let me know.
There are several ways to do this in JS
const copy = [...original]; // es6 only, uses Symbol.iterator
const copy = original.slice(); // slices the array from index 0,
// returning a shallow copy
const copy = Array.from(original, val => val); // es6 only, takes an
// array-like object with .length property and a map function
const copy = original.map(x => x);
// call to Array.prototype.map with identity function.
With those you can have :
const a = [1, 2];
const b = // shallow copy with one of the methods
a.push(3); // and b is still [1, 2]
A quick note regarding the other answers : a rapid look at the angular docs here seems to indicate that angular.copy returns a deep copy.
It is really important to grasp the difference : a shallow copy will merely create a new object and put all the values inside it, whereas a deep copy will try to make a copy of each of those values. What it means is that as objects in JS are mutable, if you create a shallow copy, you still share all of its values with the other copies. This is not the case with a deep copy.
e.g :
const a1 = [{a: {b: 3}}];
const a2 = // shallow copy
(a1 === 2) // false
a1[0].a.b = 4 // reassign a prop of a value contained inside a1
(a1[0].a.b === 4) // true
If a deep copy had been made, a new object would have been made.
Conclusion : use what you need depending of your use case. A shallow copy is quick to be made, but is subject to unwanted mutations, a deep copy is much more expensive to create but immune to mutations caused by share access. As a side note, there of course an impact on GC of these two approach (meaning a shallow copy will not release the references to values contained in the original).