Learn JavaScript

Lesson 4 of 9 ¡ Forms, Storage and Small Apps

Module 15 ¡ Forms, Storage and Small Apps

When to Use localStorage, sessionStorage, a Server, or a Timestamp

Free with an accountReading

Kenji has built three apps from Lesson 03, and now the questions are about choices. A student asks why her notes are missing on her phone. A teacher wants the timer's settings to follow her from the lab to her laptop. A parent sorts saved exam dates and gets them in a strange order. None of these is a bug in a line of code. Each is the wrong place, or the wrong shape, for the data.

Checking what this lesson needs for youâ€Ļ

What is inside When to Use localStorage, sessionStorage, a Server, or a Timestamp

  1. localStorage or a server
  2. sessionStorage or localStorage
  3. Storage or a cookie
  4. When IndexedDB earns its cost
  5. A Date or a timestamp number
  6. Dates as text: which shape to store
  7. Validation: the browser, your script, the server
  8. The comparison table