Skip to content

rococodogs/random-array-index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published