# uniquerandomarray

> Get consecutively unique elements from an array

Latest version **1.0.0** (published 2017-10-13) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install uniquerandomarray
pnpm add uniquerandomarray
yarn add uniquerandomarray
bun add uniquerandomarray
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-10-13 |
| First published | 2017-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yoginth |
| Maintainers | yoginth |
| Keywords | unique, uniq, random, rand, number, single, generate, non-repeating, array, arr, item, element |

## Links

- npm: https://www.npmjs.com/package/uniquerandomarray
- Repository: https://github.com/yoginth/uniquerandomarray
- Homepage: https://github.com/yoginth/uniquerandomarray#readme
- Issues: https://github.com/yoginth/uniquerandomarray/issues
- npm.io page: https://npm.io/package/uniquerandomarray

## Dependencies (1)

- [unique-random](https://npm.io/package/unique-random.md) ^1.0.0

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-10-13

## README

# uniquerandomarray [![Build Status](https://travis-ci.org/yoginth/uniquerandomarray.svg?branch=master)](https://travis-ci.org/yoginth/uniquerandom-array)

> Get consecutively unique elements from an array

Useful for things like slideshows where you don't want to have the same slide twice in a row.


## Install

```sh
$ npm install --save uniquerandomarray
```


## Usage

```js
var uniqueRandomArray = require('unique-random-array');
var rand = uniqueRandomArray([1, 2, 3, 4]);

console.log(rand(), rand(), rand(), rand());
//=> 4 2 1 4
```


## API

### uniqueRandomArray(input)

Returns a function that when called will return a random element that's never the same as the previous.

#### input

*Required*  
Type: `array`

## License

MIT © [Yoginth](https://yoginth.ml)

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