Workshop › Rhythm Lanes › Step 33 of 35
The best score is saved in the browser with localStorage, so it is still there next time, and shown on the panel.
```js
let best = Number(localStorage.getItem('rhythm-best')) || 0
state = 'done'
if (score > best) {
best = score
localStorage.setItem('rhythm-best', best)
}
ctx.fillText(accuracy() + '% accurate, best ' + best, canvas.width / 2, 262)
```localStorage.getItem('rhythm-best') reads the saved text (or null); Number(...) turns it into a number.
|| 0 uses 0 when there is nothing.best and is saved with setItem.let state write let best.update, under state = 'done', write the if (score > best) block.Skills: Game states
← Play again Lanes you can tap →