Last active
August 29, 2015 14:00
-
-
Save aswebdev/3323f1d84ddf6053bafd to your computer and use it in GitHub Desktop.
Looping a JavaScript array as per a PHP array_map
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
var set1 = [2, 4, 6, 8, 10]; | |
var set2 = [2, 4, 5, 8, 10]; | |
console.log(set1.every(function (a) { | |
return a % 2 === 0; | |
})); // true | |
console.log(set2.every(function (a) { | |
return a % 2 === 0; | |
})); // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment