深拷贝
//深拷贝
deepCopy(obj) {
var data;
if (typeof obj === "object") {
if (obj === null) {
data= null;
} else {
if (obj instanceof Array) {
data = [];
for (var i = 0, len = obj.length; i < len; i++) {
data.push(this.deepCopy(obj[i]));
}
} else {
data = {};
for (var j in obj) {
data[j] = this.deepCopy(obj[j]);
}
}
}
} else {
data = obj;
}
return data;
}