📅  最后修改于: 2022-03-11 15:02:52.693000             🧑  作者: Mango
//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;