that assigns one array to another (i believe they refer to it as being ‘by reference’?), which is not the same as a copy.
you could use newArray=array.map((x)=>x)
that copies each individual value to create a new array
You’ve got it right.
Primitive types (strings, numbers, booleans, ‘undefined’, ‘null’) are copied by value, but objects (everything else is a type of object) are copied by reference.
let num1 = 42;
let num2 = num1;
num1 = 69;
console.log(num1); // 69
console.log(num2); // 42
let arr1 = ['a', 'b', 'c'];
let arr2 = arr1; // there is one array in memory that both of these variables link to
console.log(arr1); // ['a', 'b', 'c', 'd', 'cheese']
console.log(arr2); // ['a', 'b', 'c', 'd', 'cheese']