...点copy是浅拷贝
var obj1 = [1,{a: 1}];
//var obj2 = Object.assign( {}, obj1);//浅copy
//var obj2 = JSON.parse(JSON.stringify(obj1));//深copy
var obj2 = [...obj1];//浅copy
obj2[1].a = 5;
obj1;
js深浅copy-LMLPHP

05-11 22:45