Skip to content

Commit

Permalink
chore: add docs for removeDuplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Tkacz committed Oct 2, 2024
1 parent 4607241 commit d7f9882
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/array-utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ Return a copy of the given array without falsy values (eg: false, 0, '', null, u
const array = ['', false, null, 'valid', 1, undefined, 0]
console.log(removeFalsy(array)) // result: ['valid', 1]
```

`removeDuplicates<const T>(array: readonly T[]): T[]`

Return a copy of the given array without duplicates.

```typescript
const array = [0, 0, 1, 'a', 'a', 'b']
console.log(removeDuplicates(array)) // result: [0, 1, 'a', 'b']
```

0 comments on commit d7f9882

Please sign in to comment.