From 7e6e4ef513aa9f937d412acf40c3f244d4ed9e48 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 15 Jan 2022 21:41:31 +0900 Subject: [PATCH] Update rand.js --- lib/rand.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/rand.js b/lib/rand.js index 60a749c..1f30147 100644 --- a/lib/rand.js +++ b/lib/rand.js @@ -59,12 +59,17 @@ function shuffle(arr) { }); } +function rotate(arr, i) { + return arr[i % arr.length]; +}; + exports.randomize = randomize; exports.getInt = getInt; exports.one = one; exports.makeString = makeString; exports.uuidv4 = uuidv4; exports.shuffle = shuffle; +exports.rotate = rotate; exports.VERSIONINFO = "Random Module (random.js) version 0.2"; exports.global = global;