Workshop › Frogger-style Crossing › Step 21 of 22
The best score is saved in localStorage when a game ends and shown next to the score.
```js
let best = Number(localStorage.getItem('frogger-best')) || 0
if (score > best) {
best = score
localStorage.setItem('frogger-best', best)
}
ctx.fillText('Score: ' + score + ' Best: ' + best, 10, 27)
```let furthest, write best.die, save the record after state = 'over'.draw, add the best score to the score text.Skills: Game states
← Next level Build it yourself: a time limit →