Workshop › Typing Rain › Step 18 of 33
Each finished word scores one point per letter: long words are harder, so they are worth more. The score is shown at the top left.
```js
let score
score = 0
words = words.filter((w) => w !== target)
score += target.text.length
ctx.font = 'bold 16px sans-serif'
ctx.fillText('Score ' + score, 10, 22)
```score starts at 0 and grows by the word's length when it is finished.textAlign = 'right', so it is still left-aligned (from the words), at (10, 22).let lives write let score; in reset, under lives = 3, write score = 0.type, under the line that removes the finished word, write score += ....draw, under ctx.font = 'bold 16px sans-serif', write the score line.Skills: Game states