0.3.0 • Published 5 months ago

jshuffle v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

jshuffle

Random shuffling and sampling

Installation

npm install jshuffle

Usage

import { sample, shuffle, toSampled, toShuffled } from 'jshuffle';

// Shuffles an array in place.
console.log(shuffle([1, 2, 3, 4, 5]));

// Shuffles an array out of place.
console.log(toShuffled([1, 2, 3, 4, 5]));

// Chooses samples in place.
console.log(sample([1, 2, 3, 4, 5], 3));

// Chooses samples out of place.
console.log(toSampled([1, 2, 3, 4, 5], 3));
0.3.0

5 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.1.0

6 months ago

0.0.0

6 months ago