原文链接https://www.jianshu.com/p/a0077ea28dcb
// 数组拷贝
copyArr (obj) {
var out = []
var i = 0
var len = obj.length
for (; i < len; i++) {
if (obj[i] instanceof Array) {
out[i] = this.copyArr(obj[i])
} else {
out[i] = obj[i]
}
}
return out
}
网友评论