Hi, question on this: Spread
It explains how to copy an array easily using spread … operator
let thisArray = [true, true, undefined, false, null];
let thatArray = [...thisArray];
// thatArray equals [true, true, undefined, false, null]
// thisArray remains unchanged, and is identical to thatArray
Just wondering what is the difference or why it is easier than just copy assigning one array to another as follows?
let thisArray = [true, true, undefined, false, null];
let thatArray = thisArray;
console.log(thatArray)
console.log(thisArray)
//Returns
[ true, true, undefined, false, null ]
[ true, true, undefined, false, null ]