Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including random-uniq-array with all npm packages installed. Try it out:

var randomUniqArray = require("random-uniq-array")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

random-uniq-array v1.0.1

Select a unique element from an array successively

random-uniq-array

Get a unique element from an array successively

Install

$ npm install --save random-uniq-array

Usage

const randomUniqArray = require('random-uniq-array')

const arr = ['earth', 'mars', 'jupiter', 'saturn']
const random = randomUniqArray(arr)

console.log(random(), random(), random())
// prints mars, earth, saturn
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free