Skip to content

draw

“Draw” a random item from an array. The item is not removed from the array. Returns `null` if the array is empty.

Usage

const numbers = [1, 2, 3];
draw(numbers); // => 2
numbers; // => [1, 2, 3]

Installation

Terminal window
npx atmx add helper draw