UNPKG

@erikyuzwa/rogue-punk

Version:

a JavaScript library to help you build your roguelike adventures

2 lines (1 loc) 111 B
export const getRandomElement = (arr) => arr.length ? arr[Math.floor(Math.random() * arr.length)] : undefined;