random-items
A function that returns a new array with random unique items from an array.
Install
npm install random-items
Usage example
; const array = 0 1 2 3 4 5 6 7 8 9; ; // Output: [ 3 ]; // Output: [ 4, 5 ]; // Output: [ 9, 5, 6, 0 ]; // Output: Error: Not long enough array to return 11 random elements.; // Output: []; // Output: []