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