Skip to content

Instantly share code, notes, and snippets.

@peterschwarz
Created August 1, 2014 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterschwarz/93eb51790b0ca3f8ea6b to your computer and use it in GitHub Desktop.
Save peterschwarz/93eb51790b0ca3f8ea6b to your computer and use it in GitHub Desktop.
Do all underscore addition
_.doAll = function(fn) {
var fns = Array.prototype.slice.call(arguments);
return function() {
var self = this;
var target_args = Array.prototype.slice.call(arguments);
return _.map(fns, function(fn) {
return fn.apply(self, target_args)
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment