You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* Title: Module Pattern - clone and inheritance Augmentation
Description: This pattern import modules, and add properties, then export it. It has adventage for developing large applications. And the new module object will inheritance the old one.
*/
varMODULE_TWO=(function(old){
varmy={},
key;
// let my object inherience property
for(keyinold){
if(old.hasOwnProperty(key)){
my[key]=old[key];
}
}
varsuper_moduleMethod=old.moduleMethod;
my.moduleMethod=function(){
// override method on the clone, access to super through super_moduleMethod