This package is a simple implementation of the Fisher Yates Shuffle algorithm. It is a simple and efficient algorithm to shuffle a list of elements.
npm install fisher-yates-shuffle
or
yarn add fisher-yates-shuffle
or
pnpm add fisher-yates-shuffle
const shuffle = require("fisher-yates-shuffle");
const list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const shuffledList = shuffle(list);
import { FisherYates } from "fisher-yates-shuffle";
const list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const shuffledList = FisherYates(list);