Skip to content

Instantly share code, notes, and snippets.

@tcelestino
Created October 12, 2021 21:15
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 tcelestino/52e277fb8cbdcc47f509e29b9b900b6f to your computer and use it in GitHub Desktop.
Save tcelestino/52e277fb8cbdcc47f509e29b9b900b6f to your computer and use it in GitHub Desktop.
js tips
// 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