How to Save High Scores in Local Storage

Michael Karén
4 min readJan 11, 2021
Photo by Senad Palic on Unsplash

After creating a game, it would be nice to save our best scores. If we only save the score in memory it will be gone the next time we play. Instead, we can save the scores in the browser’s local storage.

This article steps through how to save high scores in local storage and then how to present them on the screen for the player. If you want to read about the games that inspired this article…

Michael Karén

Frontend Architect • JavaScript Enthusiast • Author • ngVikings organizer.