0.0.1 • Published 3 years ago

array-pick-random v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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 ]
);