Skip to content

Instantly share code, notes, and snippets.

@martinabrahams
Created September 27, 2017 02:37
Show Gist options
  • Save martinabrahams/d18f8fc95be09adf5535e08b0d6dc0d4 to your computer and use it in GitHub Desktop.
Save martinabrahams/d18f8fc95be09adf5535e08b0d6dc0d4 to your computer and use it in GitHub Desktop.
Get distinct items in array in TypeScript - source https://stackoverflow.com/a/45886147/6732882
Array.from(new Set(yourArray.map((item: any) => item.id)))
@TharinduDG
Copy link

👍

@majid-n
Copy link

majid-n commented Nov 13, 2018

amazing

@ayazdink
Copy link

amazed

@alrabe
Copy link

alrabe commented Jan 9, 2020

Works even for dates-strings 👍

@nhustak
Copy link

nhustak commented Jan 10, 2020

This is awesome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment