Workshop › Asteroids › Step 38 of 41
When the game ends with a higher score than ever, it becomes the best and is saved in localStorage, the browser's
small notebook that keeps its contents after the page is closed.
```js
let best = Number(localStorage.getItem('asteroids-best')) || 0
if (score > best) {
best = score
localStorage.setItem('asteroids-best', best)
}
```getItem reads the saved text (or null); Number(...) || 0 turns it into a number, or 0 when there is none.best and is saved with setItem.let now = 0 write the best line.crash, under state = 'over', write the record if.Skills: Game states