Last active
August 6, 2016 22:25
-
-
Save koozdra/587bc424bdcc762ec86080c255842ad5 to your computer and use it in GitHub Desktop.
Any and All
This file contains hidden or 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
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