Skip to content

Instantly share code, notes, and snippets.

@bjruberg
Created October 1, 2018 19:12
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 bjruberg/ce6b0e5cbf7f05eeff7cb17e98233e1f to your computer and use it in GitHub Desktop.
Save bjruberg/ce6b0e5cbf7f05eeff7cb17e98233e1f to your computer and use it in GitHub Desktop.
// native
array.map(item => item.field)
array.filter(item => item.value === 1)
array.sort(item => item.value)
// lodash's shorter variants
_.map(array, "field")
_.filter(array, { value: 1 })
_.sort(array, "value")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment