UNPKG

@erikyuzwa/rogue-punk

Version:

a JavaScript library to help you build your roguelike adventures

6 lines (5 loc) 261 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRandomElement = void 0; const getRandomElement = (arr) => arr.length ? arr[Math.floor(Math.random() * arr.length)] : undefined; exports.getRandomElement = getRandomElement;