The question to explore

Build Mira’s character card

How can a program keep facts separate?

About 8 minutes / Suggested pace / No account needed

  • Record
  • JSON
  • State
Try the experiment

What this activity helps you do

Change Mira’s age and watch one JSON value change. Separate named fields let a program find her age directly. Having a field for a fact does not make the fact correct.

Local teaching illustration / No AI model call

  1. Find the name and age fields in the JSON record.
  2. Edit Character name or choose a whole-number Age from 17 to 21. The JSON updates as you edit.
  3. Restore her age to 17. Explain the difference between a field name and its value.
{ "name": "Mira", "age": 17 }

Change a control to explore the example when JavaScript is enabled.

The idea

A record gives each piece of information a name, such as name or age. JSON writes that record as text. Text values use quotes; numbers do not need them.

State means the values the program holds right now. Editing this record changes this activity, not the agreed facts in other lessons. Mira starts at 17. A readable record can still contain the wrong age.

Take this with you

What changed?

Structured data gives each fact a place, but structure alone does not make a fact correct.

Try explaining it.

Could a perfectly readable JSON record give Mira the wrong age?

Open a possible explanation

Yes. Valid structure and correct story facts are separate checks. You can parse a record successfully and still need to compare it with the agreed character notes.

Choose what to try next

Keep exploring, or stay here and try another variation.

By Jonathan Simone, with AI assistance. First edition, October 2026. Activities are fictional teaching examples, not measured AI performance. Help us improve this lesson.

An optional completion mark and your explanation preference can be saved to this browser. Exercise entries stay in this page unless you choose to download a file. View or clear your check-ins.