File size: 243 Bytes
c1039c9
2898d65
 
 
 
 
 
c1039c9
 
2898d65
1
2
3
4
5
6
7
8
9
10
export function shuffleArray<T>(items: T[]): T[] {
  for (let i = items.length - 1; i > 0; i--) {
    const j = Math.floor(Math.random() * (i + 1));
    const temp = items[i];
    items[i] = items[j];
    items[j] = temp;
  }

  return items
}