A random number function is an equation that mimics randomness, but it is still a function. If you give him the same seed, the first answer will be the same.
You can try changing the seed and do this when javascript is loaded first, so if there is a time component in the random number generator, it can use the delay of the loaded pages to randomize the numbers more.
But you may want to change the seed. You can use the Date() function, then get the milliseconds and use it as a seed, and this can help to scramble it first.
My idea that there is a time component in the generator is that it changes with a warning, as it lingers on creating the next number, although I have not tested it.
UPDATE:
I understand that the specification states that there is no parameter for Math.random, but the seed is used.
I came to this with C, and then in Java, so the fact that there was no error using the argument made me think that he used it, but now I see that this is not true.
If you really need seed, it's best to write a random number generator, and then Knut's books are the best starting point for this.
source share