Created
June 21, 2016 14:45
-
-
Save brainyfarm/322bf191225d847d4b61cd6a7b09a2be to your computer and use it in GitHub Desktop.
Olawale/FreeCodeCamp Algorithm: Falsy Bouncer
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
function bouncer(arr) { | |
// Filter through the array and return values that do not evaluate to false through Boolean() | |
return arr.filter(function(a){return Boolean(a);}); | |
} | |
bouncer([7, "ate", "", false, 9]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment