Skip to content

Instantly share code, notes, and snippets.

@mtroiani
Created December 12, 2015 18:37
Show Gist options
  • Save mtroiani/800df835c75bddd120ee to your computer and use it in GitHub Desktop.
Save mtroiani/800df835c75bddd120ee to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/mtroiani 's solution for Bonfire: Falsy Bouncer
// Bonfire: Falsy Bouncer
// Author: @mtroiani
// Challenge: http://www.freecodecamp.com/challenges/bonfire-falsy-bouncer
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function bouncer(arr) {
function bounce(id) {
return Boolean(id);
}
var theList = arr.filter(bounce);
return theList;
}
bouncer([7, "ate", "", false, 9]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment