js深拷贝
let obj = new Object();
obj.name = '张三';
obj.age = 18;
obj.hobby = ['玩游戏', '看电影', ['打篮球']];
function kb(obj) {
let newobj = new Object();
if(obj instanceof Array) newobj=new Array()
if (typeof obj !== 'object') re..
原创
2021-10-04 13:44:55 ·
80 阅读 ·
0 评论