Skip to content

shuffle

Clone an array and shuffle its items randomly.

Usage

const numbers = [1, 2, 3, 4, 5];
const shuffled = shuffle(numbers); // => [2, 1, 4, 5, 3]
shuffled !== numbers; // => true

Installation

Terminal window
npx atmx add helper shuffle