Closed s3ththompson closed 6 years ago
Might be nice to have .shuffle() alongside .sort(). I've implemented it manually with:
.shuffle()
.sort()
function shuffle (array) { var i = 0 , j = 0 , temp = null for (i = array.length - 1; i > 0; i -= 1) { j = Math.floor(Math.random() * (i + 1)) temp = array[i] array[i] = array[j] array[j] = temp } }
super down for this!
added here: https://github.com/jondashkyle/nanopage/commit/6526c150c623b4786fa3cb9202de3b6fe50938ac
Might be nice to have
.shuffle()
alongside.sort()
. I've implemented it manually with: