Workshop › Hangman › Step 17 of 36
Showing the wrong letters saves the player from trying them again. They are the guessed letters not in the word.
```js
function draw() {
// ...
ctx.fillText('Misses ' + wrong + ' / ' + MAX_WRONG, 260, 100)
ctx.fillStyle = '#b91c1c'
ctx.fillText([...guessed].filter((l) => !word.includes(l)).join(' '), 260, 130)
```[...guessed] turns the Set into an array..filter((l) => !word.includes(l)) keeps only the letters the word does not contain..join(' ') makes them one text: 'Q X'. It is drawn in red under the counter.In draw, under the Misses line, write the two lines. Press Run and try some letters.
Skills: Arrays and objects
← Show the misses Draw a line →