summaryrefslogtreecommitdiff
path: root/src/utils/randInRange.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/randInRange.js')
-rw-r--r--src/utils/randInRange.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/randInRange.js b/src/utils/randInRange.js
new file mode 100644
index 0000000..528221a
--- /dev/null
+++ b/src/utils/randInRange.js
@@ -0,0 +1,4 @@
+const randomInRange = (min, max) => {
+ // min <= random number <= max
+ return Math.floor(Math.random() * (max - min + 1)) + min;
+} \ No newline at end of file