From 79bb43b851d38cf73692cfd6f100636cd2cf2592 Mon Sep 17 00:00:00 2001 From: Slincnik Date: Tue, 7 Jan 2025 19:25:42 +0300 Subject: [PATCH] refactor(helpers): refactor randomNum func --- src/helpers/functions.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/helpers/functions.js b/src/helpers/functions.js index 578d6f55..0b435883 100644 --- a/src/helpers/functions.js +++ b/src/helpers/functions.js @@ -62,10 +62,7 @@ export function shuffle(pArray) { * @returns {number} A random integer between min and max. */ export function randomNum(min = 0, max = 100) { - min = Math.floor(min); - max = Math.floor(max); - - return Math.floor(Math.random() * (max - min + 1) + min); + return (Math.random() * (max - min + 1)) << 0; } /**