/** * 深拷贝js对象 * @param obj * @returns {{}} * Created by shantao on 2016/2/1. */ var deepCopy = function(obj) { var newO = {}; if (obj instanceof Array) { newO = []; } for ( var key in obj) { var val = obj[key]; newO[key] = typeof val === 'object' ? arguments.callee(val) : val; } return newO; }