Workshop › Wolfenstein-style 3D Maze › Step 16 of 18
The fastest escape is kept in localStorage and shown next to the time. Here the best is the smallest number of frames.
```js
let best = Number(localStorage.getItem('ray-best')) || 0
if (best === 0 || frames < best) {
best = frames
localStorage.setItem('ray-best', best)
}
ctx.fillText('Time ' + seconds(frames) + (best ? ' Best ' + seconds(best) : ''), canvas.width - 10, 22)
```(best ? ... : '') adds the best time only when there is one.frames, write best.Skills: Game states