Workshop › Hangman › Step 12 of 36
Not every key is a letter: 'Enter', '1', 'Shift'... We guess only when the key is one character long and one
of the 26 letters.
```js
const LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
if (letter.length === 1 && LETTERS.includes(letter)) guess(letter)
```LETTERS holds the 26 capital letters.letter.length === 1 asks: is it one character long? ('ENTER' is 5.)LETTERS.includes(letter) asks: is it one of the 26 letters? ('1' is not.)&& means "and": both must be true to call guess.] write the LETTERS line.guess(letter) with the if line. Press Run.Skills: Keyboard and mouse input
← Guess with the keyboard Count the misses →