Skip to content

Instantly share code, notes, and snippets.

@dmitriyzyuzin
Created April 29, 2021 17:55
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 dmitriyzyuzin/ba859e31914c5e4a4524c70b8c963cd5 to your computer and use it in GitHub Desktop.
Save dmitriyzyuzin/ba859e31914c5e4a4524c70b8c963cd5 to your computer and use it in GitHub Desktop.
Filter array of objects by property value

arr - array of objects
id - filter value

arr.filter((item, index, arr) => arr.findIndex(_item => _item.id === item.id) === index)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment