diff options
Diffstat (limited to 'src/helpers/array-helpers.ts')
-rw-r--r-- | src/helpers/array-helpers.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/helpers/array-helpers.ts b/src/helpers/array-helpers.ts index 45ff932ba..5d28af433 100644 --- a/src/helpers/array-helpers.ts +++ b/src/helpers/array-helpers.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | export const shuffleArray = (arr: any[]): any[] => | 1 | export default function shuffleArray(arr: any[]): any[] { |
2 | arr | 2 | return arr |
3 | .map(a => [Math.random(), a]) | 3 | .map(a => [ Math.random(), a ]) |
4 | .sort((a, b) => a[0] - b[0]) | 4 | .sort((a, b) => a[ 0 ] - b[ 0 ]) |
5 | .map(a => a[1]); | 5 | .map(a => a[ 1 ]) |
6 | }; | ||