Randomly get unique item from array
Randomly get unique (non-repeating) item from array that's never the same as the previous.
Usage
const RandomList = const list = 'some' 'items' 'in' 'list' /** * Get random and unique item from array. */const randomList = list randomList // -> 'items'randomList // -> 'list'randomList // -> 'some' randomList // -> 1 randomList randomList // -> 4 randomList // -> 'list'randomList // -> 'items'randomList // -> 'some'randomList // -> 'in'randomList // -> undefined (when we randomly get all items) /** * Reset array when we get all items. */const randomList2 = list repeatLoop: true // Default false randomList // -> 'list'randomList // -> 'items'randomList // -> 'some'randomList // -> 'in'randomList // -> 'some'randomList // -> 'in'randomList // -> 'list'
License
MIT