1
2
3
4
5
6
7
8
9
10
11
12
13
14
| // 深度拷贝
| function deepCopy(obj) {
| let b1 = typeof obj;
| if (b1 != 'object' || obj instanceof Array || obj == null) {
| return obj;
| }
| var newobj = {};
| for (var attr in obj) {
| newobj[attr] = this.deepCopy(obj[attr]);
| }
| return newobj;
| }
|
| export { deepCopy };
|
|