深克隆
function cloneObj (obj) {
var str, newobj = obj.constructor === Array ? [] : {};
if (typeof (obj) !== 'object') {
return;
} else {
for (var i in obj) {
newobj[i] = typeof (obj[i]) === 'object' && obj[i] ? this.cloneObj(obj[i]) : obj[i];
}
}
return newobj;
};