js 二维数组的深拷贝 二维数组的深拷贝,下记共同函数调用 //二维数组深拷贝 function deepcopy(obj) { var out = [],i = 0,len = obj.length; for (; i < len; i++) { if (obj[i] instanceof Array){ out[i] = deepcopy(obj[i]); } else out[i] = obj[i]; } return out; }...
copyArr(obj){varout=[],i=0,len=obj.length;for(;i<len;i++){if(obj[i]instanceof Array){out[i]=this.copyArr(obj[i]);}elseout[i]=obj[i];}returnout;} ©著作权归作者所有,转载或内容合作请联系作者 0人点赞 WEB前端 更多精彩内容,就在简书APP ...