liveBook · Manning

Local storage

As explained in Web Components in Action

Local storage is a browser-provided, origin-scoped key-value storage mechanism whose values are strings and can persist across browser sessions.

Local storage is browser-provided, origin-scoped key-value storage. It stores strings under named keys, and saved values can remain available after the browser closes. section 14.4

Saving a workout plan

A centralized workout-plan model serializes its current array with JSON.stringify before saving, then restores it with JSON.parse when loading. UI controls call save, load, and clear operations.

How Web Components in Action covers it

How deep it goes
Demonstrates string storage, origin-scoped keys, JSON serialization, enumeration, saving, loading, and clearing.
Examples
Uses string key-value snippets and a workout planner that saves, loads, lists, edits, and clears personal routines.
What you can do after
Operate local storage through setItem, getItem, Object.keys, JSON.stringify, and JSON.parse.
How it connects
Connects browser storage with data models, JSON serialization, UI event listeners, and workout-plan state.

Also explained in

Compare how 2 books explain local storage →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Components in Action. The section links point to the parts of the book it draws on.