Module

x/proc/mod.ts>shuffle

A better way to work with processes in Deno.
Latest
function shuffle
import { shuffle } from "https://dotland.deno.dev/x/proc@0.21.9/mod.ts";

Performs an in-place shuffle of an array in linear time.

This function uses the Fisher-Yates (also known as Knuth) shuffle algorithm to rearrange the elements in the array in a random order. The shuffle is performed in-place, meaning that it modifies the original array instead of creating a new one. The time complexity of the algorithm is O(n), where n is the number of elements in the array.

Parameters

items: T[]