Created
December 9, 2015 11:49
-
-
Save codebubb/8ca0cd79ac0cbd2c9563 to your computer and use it in GitHub Desktop.
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
| // Bonfire: Everything Be True | |
| // Author: @codebubb | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-everything-be-true | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function every(collection, pre) { | |
| // Is everyone being true? | |
| return collection.every(function(e){ | |
| return Object.keys(e).indexOf(pre) !== -1 && e[pre]; | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment