`localStorage` is synchronous and limited to ~5MB of strings. `IndexedDB` provides asynchronous, transactional storage for large structured objects and binary data.
js
localStorage.setItem("theme", "dark");100 XP to Apprentice
localStorage vs sessionStorage vs IndexedDB.
AI translates the explanation and quiz text while preserving code and answer scoring.
`localStorage` is synchronous and limited to ~5MB of strings. `IndexedDB` provides asynchronous, transactional storage for large structured objects and binary data.
js
localStorage.setItem("theme", "dark");1. What should NEVER be stored in localStorage or sessionStorage?
2. Which browser storage API is asynchronous and supports binary/structured data?
3. When does sessionStorage clear?