How is randomness achieved with Math.random in javascript? I’ve made something that picks between around 50 different options randomly. I’m wondering how comfortable I should be with using Math.random to get my randomness.
How is randomness achieved with Math.random in javascript? I’ve made something that picks between
Share
From the specifications:
So the answer is that it depends on what JavaScript engine you’re using.
I’m not sure if all browsers use the same strategy or what that strategy is unfortunately
It should be fine for your purposes. Only if you’re doing a large amount of numbers would you begin to see a pattern