草庐IT

doFooStuff

全部标签

javascript - 在揭示模块化模式对象上创建继承

我正在尝试在对象之间创建某种继承:varfoo=(function(){functiondoFooStuff(){console.log(arguments.callee.name);}return{doFooStuff:doFooStuff}})();varbar=(function(){$.extend(this,foo);functiondoBarStuff(){console.log(arguments.callee.name);doFooStuff();}return{doBarStuff:doBarStuff,}})();bar.doBarStuff();bar.doFoo