export function shuffleArray < T = any > ( array ) { const a = [ ... array ] ; for ( let i = a . length - 1 ; i > 0 ; i -- ) { const j = Math . floor ( Math . random ( ) * ( i + 1 ) ) ; const temp = a [ i ] ; a [ i ] = a [ j ] ; a [ j ] = temp ; } return a ; }