Shuffling is biased
phipsgabler opened this issue · comments
I don't even use JS, but stumbled onto your site by chance and find it rather nice.
Anyway, the second proposed snipped for shuffling,
const shuffle = arr => arr.sort(() => .5 - Math.random());
is exactly what one should not do for unbiased permutations, see https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Sorting. (The first should be fine, though.)