Node.js examples for Object:Object Operation
Clone object
/**/*from w ww.ja v a 2 s . c o m*/ * <p> * @param obj * @returns */ function clone(obj){ var cloneObj; if((typeof obj)==='object'){ var name; for(name in obj){ if((typeof obj[name])==='Object'){ cloneObj[name]=clone(obj[name]); }else{ cloneObj[name]=obj[name]; } } }else{ cloneObj=obj; } return cloneObj; }