数组里面每一项是基本数据类型的一个深拷贝
var arr = [1,2,3];
var sum = [...arr];
console.log(sum)
arr.push(4);
console.log(sum)
深拷贝
var arr = [1,2,3];
var sum = [].concat(arr);
console.log(sum)
arr.push(4);
console.log(sum)
var arr = [1,2,3];
var sum = arr.slice(0);
console.log(sum)
arr.push(4);
console.log(sum)