I have the following:
var firstFunc = function (settings){
alert('sup');
};
var secondFunc = function (settings){
alert('dude');
};
$.extend(firstFunc, secondFunc);
firstFunc();
I'm trying to get the last firstFunc() to return sup, then dude.
Context
The reason for this is I have an inheritance pattern implemented where the base object has some functionality overridden if defined by the deriving object:
if (child.close){
base.close = child.close;
}
base.close = function() {
// do stuff
}
The issue is, I always need the base object to "do stuff", I want to append the functionality of child.close to base.close. How can I achieve this?
Fiddle: http://jsfiddle.net/jEjxZ/1/