Skip to content

Instantly share code, notes, and snippets.

View Stapleton's full-sized avatar
🧠
Big Brain Hours

Taylor Stapleton Stapleton

🧠
Big Brain Hours
View GitHub Profile
@allexysleeps
allexysleeps / js
Created January 30, 2020 11:21
shuffle list js
const getRandNum = (range) => Math.floor(Math.random() * range)
const shuffleList = (list) => {
const len = list.length
for (let i = 0; i < len; i++) {
const idx = getRandNum(len - i)
const last = len - i - 1
const tmp = list[last]
list[last] = list[idx]
list[idx] = tmp