Created
August 1, 2014 18:38
-
-
Save peterschwarz/93eb51790b0ca3f8ea6b to your computer and use it in GitHub Desktop.
Do all underscore addition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.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