0.1.1 • Published 3 years ago

@r00t80y/array-shuffle v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years 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

3 years ago

0.1.0

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago