Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var object1 = function () {
- return {
- action1 : function () { console.log('action1'); },
- action2 : function () { console.log('action2'); },
- action3 : function () { console.log('action3'); }
- };
- };
- var object2 = function () {
- var extend = object1();
- extend.action2 = function () {
- console.log('actionNOTHING PLAYA!! Action2 got ownt!');
- action4 : console.log('action4');
- };
- return extend;
- };
- //var display = object1();
- var display = object2();
- console.log(display);
- for (method in display) {
- if (typeof display[method] === "function") {
- display[method]();
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement