Skip to content

Instantly share code, notes, and snippets.

@koozdra
Last active August 6, 2016 22:25
Show Gist options
  • Save koozdra/587bc424bdcc762ec86080c255842ad5 to your computer and use it in GitHub Desktop.
Save koozdra/587bc424bdcc762ec86080c255842ad5 to your computer and use it in GitHub Desktop.
Any and All
function any() {
return _.reduce(arguments, function(sum, n){ return sum || n; }, false);
}
function any() {
return _.some(arguments);
}
function all() {
return _.reduce(arguments, function(sum, n){ return sum && n; }, true);
}
function all() {
return _.every(arguments);
}
all(true, true, true);
any(false, false, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment