Skip to content

Instantly share code, notes, and snippets.

@andrienko
Created Mar 18, 2014
Embed
What would you like to do?
Assigning (extending) function.
assign = function(par,child,func){
var theOldOne = par[child];
par[child] = function(){
theOldOne.call(this,arguments);
func.call(this,arguments);
}
}
assign(window.console,'log',function(args){alert(args);});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment