refactor(helpers): refactor randomNum func

This commit is contained in:
Slincnik 2025-01-07 19:25:42 +03:00
parent cf832a0e4a
commit 79bb43b851
No known key found for this signature in database

View file

@ -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;
}
/**