leafiy
5/18/2018 - 6:53 PM

array shuffle sort #js #array

shuffle

const shuffle = arr => arr.sort(() => Math.random() - 0.5);
// shuffle([1,2,3]) -> [2,3,1]