This page is the Data & JSON activity, one foundational lesson in the twelve-lesson course.

The question to explore

Build Mira’s character card

How can a program keep facts separate?

Change Mira’s age and watch one value in the record change. Giving each fact its own name lets a program find it directly. A tidy record can still hold a wrong fact.

Local teaching illustration / No AI model call / About 8 minutes / No account needed

Try the experiment

First step: Find the name and age fields in the JSON record.

{
  "name": "Mira",
  "age": 17
}
Δ 0Live JSON record

Name: Mira / Age: 17

17
Matches story canonStory canon note: Mira, age 17

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

  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.

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.

For real data kept as separate values, the Voynich Explorer links each boxed word on a manuscript page to three transliterations, so you can read one word three ways and find where else it occurs.

Worked example: run it yourself

The script turns Mira’s record into JSON text and back, changes a copy, then shows two ways a record goes wrong: an age stored as text, and text that is not valid JSON.

Save it as record.js and run node record.js in a terminal (Node.js 18 or later), or paste it into your browser’s developer console. Download record.js

const record = { name: 'Mira', age: 17 };
const text = JSON.stringify(record);
console.log(text);

const copy = JSON.parse(text);
copy.age = 19;
console.log(record.age, copy.age);

console.log(JSON.parse('{"name":"Mira","age":17}').age + 1);
console.log(JSON.parse('{"name":"Mira","age":"17"}').age + 1);

try {
  JSON.parse("{name: 'Mira'}");
} catch (error) {
  console.log(error.name);
}

Output, as printed by Node.js 25.3.0 on 3 December 2026:

{"name":"Mira","age":17}
17 19
18
171
SyntaxError

Try it

What does JSON.stringify({ name: 'Mira', age: 17, mood: undefined }) print? Predict it, then run it.

Check your answer

{"name":"Mira","age":17}. JSON has no undefined, so stringify leaves that field out without an error. Checking a record for the fields you expect catches this.

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 a next step

Continue the course in order, or open the course map.