-
-
Save parzibyte/f2b8c96988eb92a5101f1f8314c028da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async chooseWord() { | |
// Get words stored in localstorage | |
const words = getWords(); | |
if (!words.length) { | |
await Swal.fire("Please add some words so you can play (go to Manage words)"); | |
window.location = "./words.html"; | |
} | |
// Choose random | |
let word = words[Math.floor(Math.random() * words.length)]; | |
this.prepareWord(word); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment