Skip to content

Commit

Permalink
Applied prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
koss-service committed Nov 29, 2023
1 parent cfb1e31 commit 6694b92
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/util/shuffle.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// function to randomly shuffle an array
export function shuffle(array: any[]):any[] {
let arraycopy: any[]= [];
array.forEach((val: any) => arraycopy.push(Object.assign({}, val)));
for (let i = arraycopy.length - 1; i > 0; i--) {
let j = Math.floor(Math.random() * (i + 1));
let temp:any = arraycopy[i];
arraycopy[i] = arraycopy[j];
arraycopy[j] = temp;
}
return arraycopy;
}
export function shuffle(array: any[]): any[] {
let arraycopy: any[] = [];
array.forEach((val: any) => arraycopy.push(Object.assign({}, val)));
for (let i = arraycopy.length - 1; i > 0; i--) {
let j = Math.floor(Math.random() * (i + 1));
let temp: any = arraycopy[i];
arraycopy[i] = arraycopy[j];
arraycopy[j] = temp;
}
return arraycopy;
}

0 comments on commit 6694b92

Please sign in to comment.