//Shuffles a list using durstenfeld algorithm shuffle(a) var j, m, i for (i = a.length - 1; i > 0; i--) { j = Math.floor(Math.random() * (i + 1)); m = a[i] a[i] = a[j] a[j] = m; } return a;