import randomInt from "./randomInt" ; param { Array } a export default function shuffleInPlace < T > ( a ) { for ( let i = a . length - 1 ; i > 0 ; i -- ) { const j = randomInt ( i + 1 ) ; const temp = a [ i ] ; a [ i ] = a [ j ] ; a [ j ] = temp ; } return a ; }