Skip to content

Commit

Permalink
Update randomizeElements.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ircfspace committed Mar 3, 2024
1 parent 9f3d7b3 commit c978a7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/randomizeElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function randomizeElements<T>(arr: T[]): T[] {
const result: T[] = [...arr];
for (let i: number = result.length - 1; i > 0; i--) {
const j: number = Math.floor(Math.random() * (i + 1));
[result[i], result[j]] = [result[j], result[i]];
[result[i]!, result[j]!] = [result[j]!, result[i]!];
}
return result.slice(0, 100);
}

0 comments on commit c978a7d

Please sign in to comment.