Skip to content

Instantly share code, notes, and snippets.

@osartun
Created November 30, 2012 16:09
Show Gist options
  • Save osartun/4176696 to your computer and use it in GitHub Desktop.
Save osartun/4176696 to your computer and use it in GitHub Desktop.
Adds areFunctions, areStrings, areNumbers, areDates and areRegExps to the UnderscoreJS-Object
(function (_) {
_.each("Function String Number Date RegExp".split(" "), function(name) {
_["are" + name + (name.substr(-1) !== "s" ? "s" : "")] = function () {
return _.all(_.toArray(arguments), _["is" + name]);
}
});
})(_);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment