Added random pick module.

This commit is contained in:
2022-10-21 22:52:13 +02:00
parent be30882ed7
commit 73646482c9
+9
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;