# unique-array

> Removed duplicate elements from the array

Latest version **1.0.1** (published 2016-02-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install unique-array
pnpm add unique-array
yarn add unique-array
bun add unique-array
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-02-12 |
| First published | 2016-01-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Vikram |
| Maintainers | vikramcse |
| Keywords | array, arr, set, uniq, unique, duplicate, remove |

## Links

- npm: https://www.npmjs.com/package/unique-array
- Repository: https://github.com/vikramcse/unique-array
- Homepage: https://github.com/vikramcse/unique-array#readme
- Issues: https://github.com/vikramcse/unique-array/issues
- npm.io page: https://npm.io/package/unique-array

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-02-12
- 1.0.0 — 2016-01-28

## README

# unique-array

Removed duplicate elements from the array using Set

## Examples

```js
var unique = require('unique-array');

unique([1, 1, 2, 3, 4]);
//=> [1, 2, 3, 4]

unique(['a', 'b', 'github', 'a', 'github']);
//=> ['a', 'b', 'github']
```

When removing duplicates, the position of the first occurrence of each value will be retained. For example,

```js
unique([1, 2, 3, 4, 4, 5, 1, 6])
//=> [1, 2, 3, 4, 5, 6]
```

## Usage

#### `require('unique-array')( array )`
Return unique elements of an input array.

**Arguments**:
- `array`: A javascript array with elements to be unique'd.

**Returns**: A reference to a new array containing the unique elements. Elements are in the order of the first occurrence in the input array.

## License

&copy; 2016 vikram. MIT License

---
_Source: https://npm.io/package/unique-array · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
