diff --git a/src/utils/pick-random.js b/src/utils/pick-random.js new file mode 100644 index 0000000..779af95 --- /dev/null +++ b/src/utils/pick-random.js @@ -0,0 +1,9 @@ +'use strict'; + +const crypto = require('crypto'); + +function pickRandom(array) { + return array[crypto.randomInt(0, array.length)]; +} + +module.exports = pickRandom;