});
}
- constructor() {
- this.dataurl = '/data/wordlist.nl.json';
- fetch(this.dataurl).then(res => res.json()).then(json => {
+ constructor(dataurl) {
+ fetch(dataurl).then(res => res.json()).then(json => {
this.form = document.getElementById('quiz');
this.words = Object.values(json)
.sort(() => {return .5 - Math.random()}) // shuffle
});
}
};
-
-new Quiz();