Skip to content

Instantly share code, notes, and snippets.

@robdodson
Created August 30, 2012 16:23
Show Gist options
  • Select an option

  • Save robdodson/3532283 to your computer and use it in GitHub Desktop.

Select an option

Save robdodson/3532283 to your computer and use it in GitHub Desktop.
function test(arg){
return arg + arg;
}
function testDecorator(fn, args){
var arg = args[0] * 2;
return fn(arg);
}
function decorate(dec, fn, args){
return function(){
return dec(fn, args);
}
}
x = decorate(testDecorator, test, [2])();
console.log(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment