1.0.0 • Published 8 years ago

a-random v1.0.0

Weekly downloads
9
License
ISC
Repository
github
Last release
8 years ago

a-random

Get random elements from on array

Install

$ npm install --save a-random

Examples

const getRandom = require('a-random');

console.log(getRandom(['a', 'github', 'facebook', 'youtube', 'google', 1], 3));
// => ['a', 'youtube', 1]

Usage

require('a-random')( array, elements )

Arguments:

  • array: array
  • elements: No of random elements want to be return
  • elements Must be smaller or the equal length of array

Returns: Returns array of random elements

License

© 2016 vikram. MIT License