import { shuffle } from "https://deno.land/x/ayonli_jsext@v0.9.72/array/index.ts";
Reorganizes the elements in the array in random order.
This function mutates the array.
Examples
Example 1
Example 1
import { shuffle } from "@ayonli/jsext/array";
const arr = [1, 2, 3, 4, 5];
console.log(shuffle(arr)); // [3, 1, 5, 2, 4] for example
console.log(arr); // [3, 1, 5, 2, 4]
Parameters
arr: T[]