Array.prototype.slicebeginnerconst original = [1, 2, 3]
const copy = original.slice() // shallow copy
copy !== original // β trueCall slice() with no arguments to create a shallow copy of an array.
Calling slice() with no arguments returns a shallow copy of the entire array. This is a common pattern to duplicate an array without mutating the original.
Challenge: Implement shallowCopy(arr) that returns a full copy using arr.slice().
shallowCopy([1, 2, 3]) // β [1, 2, 3] (new array reference)