(arr)
| 51 | } |
| 52 | |
| 53 | function shuffle(arr) { |
| 54 | const a = arr.slice(); |
| 55 | for (let i = a.length - 1; i > 0; i--) { |
| 56 | const j = Math.floor(Math.random() * (i + 1)); |
| 57 | [a[i], a[j]] = [a[j], a[i]]; |
| 58 | } |
| 59 | return a; |
| 60 | } |
| 61 | |
| 62 | function setStyles(els, styles) { |
| 63 | for (const el of els) Object.assign(el.style, styles); |