Workshop › Hangman › Step 25 of 36
After a loss it is only fair to show the word. When state is 'lost', the whole word is drawn in red.
```js
function draw() {
// ...
ctx.textAlign = 'center'
ctx.font = 'bold 32px monospace'
if (state === 'lost') {
ctx.fillStyle = '#b91c1c'
ctx.fillText([...word].join(' '), canvas.width / 2, 340)
} else {
ctx.fillStyle = '#1f2937'
ctx.fillText(masked(), canvas.width / 2, 340)
}
```if ... else chooses one of two blocks.[...word].join(' ') writes all the letters with spaces, lined up like the blanks.In draw, replace the last two lines (fillStyle and fillText(masked(), ...)) with the if ... else block.
Skills: Game states