Skip to content

Instantly share code, notes, and snippets.

@dbess1
Forked from anonymous/bonfire-falsy-bouncer.js
Created December 4, 2015 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbess1/6fbccd3c861cba038426 to your computer and use it in GitHub Desktop.
Save dbess1/6fbccd3c861cba038426 to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/dbess1 's solution for Bonfire: Falsy Bouncer
// Bonfire: Falsy Bouncer
// Author: @dbess1
// Challenge: http://www.freecodecamp.com/challenges/bonfire-falsy-bouncer
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function bouncer(arr) {
//Based on the MDN document this will Boolean function will include all falsy values
//I can just filter all of them with filter function!
return arr.filter(Boolean);
}
bouncer([7, "ate", "", false, 9]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment