Workshop › Hangman › Step 14 of 36
Pressing a wrong letter twice should not cost two misses. If the letter was already guessed, guess stops at once.
```js
function guess(letter) {
if (guessed.has(letter)) return
guessed.add(letter)
if (!word.includes(letter)) wrong += 1
}
```return leaves the function right away; the lines under it do not run.guessed is not counted again.In guess, write the new line at the very top, above guessed.add(letter). Press Run.
Skills: Game states
← Count the misses Six misses at most →