2.1.2 • Published 7 years ago

rand-paul v2.1.2

Weekly downloads
9
License
MIT
Repository
github
Last release
7 years ago

Rand Paul

Get a random value from an array.

Usage

npm install rand-paul --save
var rand = require('rand-paul');

var candidates = [
  'Ted Cruz',
  'Ben Carson',
  'Jeb Bush',
  'Mike Huckabee',
  'Rand Paul',
  'Donald Trump'
]

var president = rand.paul(candidates);
console.log(president) // => 'Rand Paul'

You can grab the index of the item by specifying it in the options object.

var president = rand.paul(candidates, {includeIndex: true});

console.log(president) // => { item: 'Rand Paul', includeIndex: 4 }

Contribution

Fork and do your thing. If your code is as messy and/or unkempt as Rand's hair I will not accept.

LICENSE

WTFPL (...)

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.0

8 years ago

1.0.0

8 years ago