mirror of
https://github.com/JonnyBro/JaBa.git
synced 2025-01-19 17:03:47 +05:00
refactor(helpers): refactor randomNum func
This commit is contained in:
parent
cf832a0e4a
commit
79bb43b851
1 changed files with 1 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue