Created
August 10, 2018 14:15
-
-
Save ldmarz/43d28b0781e7ac2aec1f9e31a8ae5d1d to your computer and use it in GitHub Desktop.
example of compact function from lodash
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
const someDirtyArray = [0, 1, false, 2, '', 3]; | |
const cleanedArray = _.compact(someDirtyArray); | |
// cleanedArray => [1, 2, 3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment