Closed anniewey closed 11 months ago
This is outside of the scope of this library.
I would recommend searching/posting on Stack Overflow. From a quick glance, this answer seems to do it the way I'd imagine you should do it: https://stackoverflow.com/a/55544949/148072
It's easy to accidentally introduce bias when going to a specific integer range, so be sure to read up properly and maybe find a library that does this on top of getRandomValues
.
How to get random number between 1 to 10? To replace
Math.random()