mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-01 15:48:23 -05:00
voting progress
This commit is contained in:
13
utils/shuffleArray.js
Normal file
13
utils/shuffleArray.js
Normal file
@@ -0,0 +1,13 @@
|
||||
//https://stackoverflow.com/a/6274381
|
||||
function shuffle(a) {
|
||||
var j, x, i
|
||||
for (i = a.length - 1; i > 0; i--) {
|
||||
j = Math.floor(Math.random() * (i + 1))
|
||||
x = a[i]
|
||||
a[i] = a[j]
|
||||
a[j] = x
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
||||
module.exports = shuffle
|
||||
Reference in New Issue
Block a user