High Scores
In this lesson, we will add high scores to the Tetris game, and you will learn how to save and load high scores from local storage.
We'll cover the following...
Now that we have made the points system, it would be nice to be able 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.
Local storage
With local storage, we can store data in the browser in the form of key-value pairs, where both the key and the value are strings. The data is persisted across browser sessions and its scope is limited to the origin where the script that accesses ...
Ask