Skip to content

Instantly share code, notes, and snippets.

@codebubb
Created December 9, 2015 11:49
Show Gist options
  • Select an option

  • Save codebubb/8ca0cd79ac0cbd2c9563 to your computer and use it in GitHub Desktop.

Select an option

Save codebubb/8ca0cd79ac0cbd2c9563 to your computer and use it in GitHub Desktop.
// 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