emptyFn : function(){},
/**
- *
+ * Clone the object
*
*
*/
clone : function(obj){
-
+ if (obj === null || typeof obj !== 'object') {
+ return obj;
+ }
+
+ var temp = obj.constructor(); // give temp the original obj's constructor
+ for (var key in obj) {
+ temp[key] = cloneObject(obj[key]);
+ }
+
+ return temp;
},
/**