array-pick-random
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Array Pick Random

Pick a number of unique items from a given array (without using array.sort)

npm

Installation

npm install --save array-pick-random

Usage

array_pick_random( array: any[], itemsCount: number ): any[];

Usage example

import array_pick_random from 'array-pick-random';

console.log(
    array_pick_random([ 1,2,3,4,5,6,7,8,9 ], 3),
    // Returns [ 6, 1, 4 ]
);

Package Sidebar

Install

npm i array-pick-random

Weekly Downloads

3

Version

0.0.1

License

MIT

Unpacked Size

1.89 kB

Total Files

4

Last publish

Collaborators

  • gaetanlegac