Skip to content

Instantly share code, notes, and snippets.

@DanShappir
Created November 6, 2019 12:30
Show Gist options
  • Save DanShappir/f5c4f70c4c7001077c437a89b8a70f83 to your computer and use it in GitHub Desktop.
Save DanShappir/f5c4f70c4c7001077c437a89b8a70f83 to your computer and use it in GitHub Desktop.
Filter object properties with pipeline
const retainOnlyNumeric = obj
|> Object.entries
|> filter(#, ([, value]) => typeof value === 'number')
|> Object.fromEntries;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment