Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Saving State in the Browser (Summary)

Well done on finishing Saving State in the Browser.

In this course, you learned how to:

  • Loop over objects and follow paths into nested data
  • Save data as JSON text in localStorage and load it on every visit
  • Catch a damaged save and upgrade old saves with a version number
  • Make an app remember its data across reloads, and keep working when the saved data is missing, corrupt, or in an older shape

In the video, Sam’s finished box loads each kind of save:

Save in storage What Sam’s box shows
None The three starter recipes, and No saved recipes yet. Showing the starter recipes.
Version 2, saved after Sam adds Pea and mint soup All four recipes after a reload, with their ingredients and the count per category
Damaged, so JSON.parse() throws a SyntaxError The three starter recipes, and Your saved recipes were damaged. Showing the starter recipes.
Version 1, from Sam’s kitchen laptop, with no version number Its two recipes, upgraded to version 2 as they load, each with No ingredients yet

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.