Created
October 12, 2021 21:15
-
-
Save tcelestino/52e277fb8cbdcc47f509e29b9b900b6f to your computer and use it in GitHub Desktop.
js tips
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
// remove false element in array | |
const friends = ['Jake', null, 'Cassidy', undefined, 'Joshy', undefined, 'Jordyn'] | |
const filteredFriends = friends.filter(Boolean) | |
filteredFriends // ["Jake", "Cassidy", "Joshy", "Jordyn"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment