Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
GMissaka committed Jul 12, 2024
1 parent d2c5aab commit 6473bdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ document.addEventListener('DOMContentLoaded', () => {
}

function usesAllDraftedLetters(word) {
const wordLetters = word.split('');
return randomLetters.every(letter => wordLetters.includes(letter));
const wordLetters = new Set(word.split(''));
return selectedLetters.every(letter => wordLetters.has(letter.toLowerCase()));
}

function finishGame() {
Expand Down

0 comments on commit 6473bdb

Please sign in to comment.