1.深克隆
/*
* 深度合并对象
*/
function deepAssign(FirstOBJ, SecondOBJ) {
if (!typeof FirstOBJ == 'object' && typeof SecondOBJ == 'object') return;
for (var key in SecondOBJ) {
FirstOBJ[key] = FirstOBJ[key] && FirstOBJ[key].toString() === '[object Object]' ? deepAssign(FirstOBJ[key], SecondOBJ[key]) : (FirstOBJ[key] = SecondOBJ[key]);
}
return FirstOBJ;
}