3 ms·
Javascript does not guarantee that, and yes, it does affect the results. I did a bit of playing with this in Firefox, sorting the array [0,1,2,3,4,5,6,7,8,9] a
by IsaacSchlueter 17y ago
Javascript does not guarantee that, and yes, it does affect the results.
I did a bit of playing with this in Firefox, sorting the array [0,1,2,3,4,5,6,7,8,9] and then testing the mean of the first 5 vs the mean of the second 5, over 10,000 iterations. Then, based on the deviation from 4.5 in each set, I nudged the random cutoff up or down.
It seems to result in most evenly distributed randomness if you change the 0.5 to 0.36725 or so. When I tracked the values to return the same result for the same pair every time, it converged almost exactly on 0.375 every time.
These numbers seem suspiciously round to me.