Added random pick module.
This commit is contained in:
parent
be30882ed7
commit
73646482c9
|
@ -0,0 +1,9 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const crypto = require('crypto');
|
||||||
|
|
||||||
|
function pickRandom(array) {
|
||||||
|
return array[crypto.randomInt(0, array.length)];
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = pickRandom;
|
Loading…
Reference in New Issue