const shuffle = arr => {
let len = arr.length
let rand = 0
while (len) {
rand = Math.floor(Math.random() * len--)
;[arr[len], arr[rand]] = [arr[rand], arr[len]]
}
return arr
}
console.log(shuffle([1, 2, 3, 4, 5, 6]));