Last active
September 2, 2021 10:22
-
-
Save Bazooka2091/1a2efb71280e6f1a67ea069f4ef44826 to your computer and use it in GitHub Desktop.
TypeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const distinct = subjects.filter( | |
(thing, i, arr) => arr.findIndex(t => t.INN === thing.INN) === i | |
); | |
// IE version | |
const distinctThings = thingsWithDuplicates.filter((thing, i, arr) => { | |
return arr.indexOf(arr.find(t => t.id === thing.id)) === i; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IData { | |
[ key: string ]: string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment