random-array-index

1.1.0 • Public • Published

random-array-index

npm i --save random-array-index

usage

var randomArrayIndex = require('random-array-index')
var things = ['cat', 'dog', 'cactus', 'dinosaur', 'sloth', 'water bottle']
var idx = randomArrayIndex(things)

console.log(idx, things[idx])

api

randomArrayIndex(array)

Returns an integer from 0 to array.length - 1

license

MIT

Readme

Keywords

Package Sidebar

Install

npm i random-array-index

Weekly Downloads

4

Version

1.1.0

License

MIT

Last publish

Collaborators

  • malantonio