SOURCE

let obj = {
    a: 1,
    b: 2
}
let newObj = { ...obj }
obj.a = 11
console.log(obj)
console.log(newObj)


let arr = [1, 2]
let newArr = [ ...arr ]
arr[0] = 11
console.log(arr)
console.log(newArr)
console 命令行工具 X clear

                    
>
console