JSON and localStorage

JSON Learning Objectives

The objective of this lesson is to familiarize you with the JSON format and how to serialize to and deserialize from that format.

The learning objectives for this lesson are that you can:

  1. Identify and generate valid JSON-formatted strings
  2. Use JSON.parse to deserialize JSON-formatted strings
  3. Use JSON.stringify to serialize JavaScript objects
  4. Correctly identify the definition of “deserialize”
  5. Correctly identify the definition of “serialize”

This lesson is relevant because JSON is the lingua franca of data interchange.

JSON Demo

localStorage Learning Objectives

Below is a complete list of the terminal learning objectives for this lesson. When you complete this lesson, you should be able to perform each of the following objectives. These objectives capture how you may be evaluated on the assessment for this lesson.

  1. Write JavaScript to store the value “I <3 falafel” with the key “eatz” in the browser’s local storage.
  2. Write JavaScript to read the value stored in local storage for the key “paper-trail”.

localStorage Demo