Skip to content

Instantly share code, notes, and snippets.

@andrienko
Created March 18, 2014 10:43
Show Gist options
  • Save andrienko/9617684 to your computer and use it in GitHub Desktop.
Save andrienko/9617684 to your computer and use it in GitHub Desktop.
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