Created
November 19, 2014 14:03
-
-
Save shaunwallace/b995544c6b6934c5851e to your computer and use it in GitHub Desktop.
Array.prototype.every()
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 isBigEnough(element, index, array) { | |
return element >= 10; | |
} | |
var passed = [12, 5, 8, 130, 44].every(isBigEnough); // passed is false | |
passed = [12, 54, 18, 130, 44].every(isBigEnough); // passed is true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment