word/quiz: common js function to shuffle arrays
[sheet.git] / word / memory.js
index 375b7c185bab825ba6eb63b5ea80862952ac6cf0..48e8b44cfb441ae2db57eba2b90482e8b19910f2 100644 (file)
@@ -45,7 +45,7 @@ class WordMemory extends WordQuiz {
                        this.form = document.getElementById('quiz');
                        this.cards = Object.entries(pairs).flat()
                                .map(e => e.toString())
-                               .sort(() => {return .5 - Math.random()}) // shuffle
+                               .shuffle()
                        this.cards.forEach(word => {
                                put(this.form,
                                        'figure>img[src=$]<', `/data/word/en/${word}.jpg`,