There are posts in SO on how to generate a random number in Javascript. One common solution is:
Math.floor(Math.random() * (max - min + 1)) + min;
But if I set my min to 0 and max to 3 and refresh my web app, the vast majority of times this function will return 0. There is clearly no even distribution on the randomness generated.
Is there a better way than doing it like this?