beginning of interface
This commit is contained in:
parent
420d719fc1
commit
ef08eea8d9
3 changed files with 93 additions and 20 deletions
8
src/utils.ts
Normal file
8
src/utils.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
export function shuffleArray<T>(array: T[]) {
|
||||
const copy = Array.from(array)
|
||||
for (let i = copy.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
[copy[i], copy[j]] = [copy[j], copy[i]];
|
||||
}
|
||||
return copy
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue