diff options
Diffstat (limited to 'src/helpers/array-helpers.ts')
-rw-r--r-- | src/helpers/array-helpers.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/helpers/array-helpers.ts b/src/helpers/array-helpers.ts new file mode 100644 index 000000000..ae5d8d99f --- /dev/null +++ b/src/helpers/array-helpers.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export const shuffleArray = (arr: any[]) => arr | ||
2 | .map((a) => [Math.random(), a]) | ||
3 | .sort((a, b) => a[0] - b[0]) | ||
4 | .map((a) => a[1]); | ||