Untitled

mail@pastecode.io avatar
unknown
typescript
2 years ago
215 B
4
Indexable
Never
const arr = [1, 2, 3, 4, 5, 8 ,6 ,7, 7]

const uniqueueIds = new Set<number>(arr);
const idsMap = new Map<number, boolean>(arr.map(value => [value, true]))

arr.find(id => id === 6);
uniqueueIds.has(6)
idsMap.has(6)