UNPKG
@leofavre/memory-game-component
Version:
latest (1.3.1)
1.3.1
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
A memory game web component.
@leofavre/memory-game-component
/
dist
/
es
/
es5
/
helpers
/
shuffle.js
12 lines
•
236 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
export default (
function
(arr)
{
return
arr.map(
function
(a)
{
return
{
sort
: Math.
random
(), value: a }; }).
sort
(
function
(a, b)
{
return
a.
sort
- b.
sort
; }).map(
function
(a)
{
return
a.value; }); });