Added random pick module.

This commit is contained in:
ThePendulum 2022-10-21 22:52:07 +02:00
parent be30882ed7
commit 73646482c9
1 changed files with 9 additions and 0 deletions

9
src/utils/pick-random.js Normal file
View File

@ -0,0 +1,9 @@
'use strict';
const crypto = require('crypto');
function pickRandom(array) {
return array[crypto.randomInt(0, array.length)];
}
module.exports = pickRandom;