Created
September 21, 2018 07:32
-
-
Save kaizer1v/97f8ff69162bc4ec4a4bc9a1b2be50b9 to your computer and use it in GitHub Desktop.
filterBoolean
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
// filters out all the falsey values and returns only valid ones | |
let arr = [7, "ate", "", false, 9]; | |
arr.filter(Boolean); // [7, 'ate', 9] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment