lynxerzhang / JSSkills

MIT License
0 stars 0 forks source link

flvjs结构记录 #19

Open lynxerzhang opened 5 years ago

lynxerzhang commented 5 years ago

Object.assign的复制对象方法需要注意,该复制行为为浅复制

var d = {"a":1, "b":2, "c":[1, 2, 3]};
var e  = Object.assign({}, d);
d.c.push(4);
console.log(d.c);  //1,2,3,4
console.log(e.c);  //1,2,3,4