Skip to content

Instantly share code, notes, and snippets.

@benfoxall
Created September 23, 2014 12:05
Show Gist options
  • Save benfoxall/aec4a1d7315a4582708f to your computer and use it in GitHub Desktop.
Save benfoxall/aec4a1d7315a4582708f to your computer and use it in GitHub Desktop.
// helper method for creating functions with
// all arguments mapped through a map_fn
function argument_map(map_fn){
return function(fn){
return function(){
return fn.apply(this,
Array.prototype.slice.call(arguments)
.map(map_fn)
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment