0.1.1 • Published 11 months ago

@r00t80y/array-shuffle v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

Array Shuffle

Implementation of the "Fisher-Yates Shuffle" algorithm

Install

pnpm i @r00t80y/array-shuffle

How to use it

import { shuffle } from '@r00t80y/array-shuffle';

console.log(shuffle([1, 2, 3, 4, 5])); // [3, 2, 5, 4, 1]
const arr1 = [1, 2, 3, 4];
const arr2 = shuffle(arr1.slice());

console.log(arr1); // [1, 2, 3, 4]
console.log(arr2); // [3, 2, 4, 1]
0.1.1

11 months ago

0.1.0

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago