UNPKG
rhodash
Version:
latest (2.2.0)
2.2.0
2.2.0-beta.1
2.1.0
2.0.0
1.6.0
1.6.0-beta.0
1.5.1
1.5.0
1.4.0
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.0
1.1.1
1.1.0
1.0.1
1.0.0
1.0.0-next.16
1.0.0-next.15
1.0.0-next.14
1.0.0-next.13
1.0.0-next.12
1.0.0-next.11
1.0.0-next.10
1.0.0-next.9
1.0.0-next.8
1.0.0-next.7
1.0.0-next.6
1.0.0-next.5
1.0.0-next.4
1.0.0-next.3
1.0.0-next.2
1.0.0-next.1
A deadly simple alternative to lodash
rhodash.vercel.app
KoichiKiyokawa/rhodash
rhodash
/
src
/
uniq.ts
9 lines
(8 loc)
•
205 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
/** * Create an array with duplicate elements removed. * *
@example
uni
q([1, 2, 1, 1, 2, 3, 4])
// => [
1
,
2
,
3
,
4
] */ export function uni
q<T>
(array: readonly T[]): T[] {
return
[...new Set(array)] }