1 Array.prototype.shuffle = function () {
2 for (let i = this.length - 1; i > 0; i--) {
3 const j = Math.floor(Math.random() * (i + 1)); // random index 0..i
4 [this[i], this[j]] = [this[j], this[i]]; // swap elements
11 // find viable rows from json data
12 let rows = Object.values(json);
13 if (this.preset.level !== undefined) {
14 rows = rows.filter(row => row[1] <= this.preset.level);
16 return rows.shuffle();
21 fetch(dataurl).then(res => res.json()).then(json => {
22 this.words = this.dataselect(json)
27 constructor(dataurl) {