Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 24, 2020 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/f2b8c96988eb92a5101f1f8314c028da to your computer and use it in GitHub Desktop.
Save parzibyte/f2b8c96988eb92a5101f1f8314c028da to your computer and use it in GitHub Desktop.
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