Local storage is like a super strong backpack that your computer uses to remember things when you're not looking.
Imagine you have a toy box at home. Every time you play with your favorite toys, you put them back in the box so they’re ready for next time. Local storage works the same way, it helps your browser save information so it can use it later.
Like a Toy Box for Your Computer
Saving Your Progress
Let’s say you’re building a tower with blocks on a website. You might want to save your progress so you don’t have to start all over again. Local storage lets the website remember how tall your tower was, just like your toy box remembers where you left your toys.
You can even put more than one toy in the backpack, or more than one thing in local storage. It’s a handy tool that helps websites keep track of what you’ve done without asking you every time.
Examples
- Saving your favorite color in a game so it stays even after you log out.
- Remembering your username automatically when you return to a website.
Ask a question
See also
- What are modern javascript practices?
- How Does The Async Await Episode I Promised Work?
- How Does JavaScript ASYNC/AWAIT is easy! ⏳ Work?
- How Does Every React Concept Explained in 12 Minutes Work?
- How Does Web Assembly (WASM) in 100 Seconds Work?