Code Lab BetaBUILD. RUN. DISCOVER.

Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.

JAVASCRIPT / CHAPTER 06

JavaScript
Storage.

Storing data: JSON vs object, parse and shape guards, window.labStorage, a list and CRUD with stable ids, corrupt data with explicit recovery, failed writes, and an expense app. Learn and Practice; challenges are separate.

Choose a section

Lesson with explanation and a guided task. Theory stays readable; completion requires a passing solution.

Challenges are optional and do not block the next chapter.

Start lesson
JavaScript

11 lessons available

The foundations behind your ideas.

  1. 01

    JSON vs Object · Locked

    JSON is text, an object is a value

    Open lesson
  2. 02

    Stringify & Parse · Locked

    JSON round-trip

    Open lesson
  3. 03

    Nested JSON · Locked

    array of objects with nested arrays

    Open lesson
  4. 04

    Invalid JSON · Locked

    try/catch around JSON.parse

    Open lesson
  5. 05

    Shape Guard · Locked

    valid JSON, wrong shape

    Open lesson
  6. 06

    labStorage Basics · Locked

    getItem, setItem, removeItem, null vs ""

    Open lesson
  7. 07

    Save a List · Locked

    array as JSON under one key

    Open lesson
  8. 08

    CRUD Records · Locked

    stable ids, edit, delete

    Open lesson
  9. 09

    Corrupt & Recover · Locked

    load error is not an empty store

    Open lesson
  10. 10

    Write Failure · Locked

    QuotaExceededError and an honest status

    Open lesson
  11. 11

    Expense App · Locked

    save and restore a list

    Open lesson
JavaScript storage — JSON, labStorage, and recovery | Code Lab