ABCsteps lesson path

JSON: The Data Format Apps Share

Every app, API, and configuration file uses structured data. Learn to read and write JSON clearly. Build one artifact, keep one review trail, and make the work easy to inspect later.

Lesson
08
Time
40 min
Access
public lesson

Learning objective

Read structured data and understand why modern apps use JSON.

Lab outcome

Model app data as valid JSON and debug common mistakes.

Module milestone

Containerize and share a working app through a verified deployment path.

Lesson proof workflow

Read, build, then review the evidence.

  1. JSON hero workflow iconStep 1ReadStart with JSON syntax before touching tools.
  2. JavaScript hero workflow iconStep 2BuildBuild toward: Model app data as valid JSON and debug common mistakes.
  3. VS Code hero workflow iconStep 3ReviewReview the evidence using Config literacy.

Toolchain

JSON is the shared language of APIs, config, and app state.

These are the practical surfaces used in this lesson. Learn the habit first, then connect it to the wider engineering ecosystem.

JSON iconJSONData format

Model structured information without ambiguity.

JavaScript iconJavaScriptParsing

Move data between strings, objects, and UI.

VS Code iconVS CodeValidation

Catch syntax errors before they become app errors.

Proof of work

Leave one inspectable trail from this lesson.

The useful output is not a passive note. It is a small artifact another person can inspect: a working file, a command result, a commit, a screenshot, a README note, or a demo link.

Lesson lab: Model app data as valid JSON and debug common mistakes.

Tool and platform logos are ecosystem references only: no affiliation, endorsement, interview access, hiring promise, salary promise, or placement guarantee.

JSON proof icon

Build

Produce the artifact

Complete the lab and keep the result visible: Model app data as valid JSON and debug common mistakes.

JavaScript proof icon

Record

Save review evidence

Capture what changed, what broke, and how JSON syntax became clearer through the work.

VS Code proof icon

Explain

Write the vocabulary

Use your own words for Data modeling and Config literacy; this is what makes the lesson inspectable later.

Skills companies recognize

Translate the lesson into inspectable work language.

This lesson turns one small lab into the language a learner can use in a README, demo note, or technical conversation. The point is not to collect logos; the point is to explain work clearly enough that another engineer can inspect it.

Where this skill appears

JSON literacy appears everywhere because products, APIs, config, analytics, and AI calls all move structured data.

API teamsData toolingApp configuration

Ecosystem references

AWS skill ecosystem logoGoogle Cloud skill ecosystem logoMicrosoft skill ecosystem logoGitHub skill ecosystem logoCloudflare skill ecosystem logoOpenAI skill ecosystem logoGoogle skill ecosystem logo

Platform and company logos are ecosystem references only: no affiliation, endorsement, interview access, hiring preference, salary outcome, or placement guarantee.

JSON skill proof icon

README line

Name the artifact

Lab proof: Model app data as valid JSON and debug common mistakes. Connect it to JSON syntax so the result reads like work, not a passive note.

JavaScript skill proof icon

Review line

Explain the stack

Use JSON, JavaScript, VS Code to explain Data modeling and what changed between the first attempt and the inspected result.

VS Code skill proof icon

Conversation line

Answer with evidence

If a team asks about Config literacy, use this proof line: Show a valid data shape, explain each field, and document the mistake you debugged.

Proof translation

JSON proof translation icon

Skill signal

JSON syntax is the market word. The lesson makes it visible through a small working artifact.

JavaScript proof translation icon

Proof artifact

The inspectable artifact is: Model app data as valid JSON and debug common mistakes.

VS Code proof translation icon

Interview answer

Use Data modeling and Config literacy to explain what changed, what failed, and how you verified it.

Paid guidance

Read publicly. Upgrade when guidance will help you finish.

This lesson remains part of the public written syllabus. Paid help is online-only and human-led: video walkthroughs as they roll out, live class context, WhatsApp Q&A, and project review around the same work.

No account wall, automated checkout, or placement promise is introduced here. Enrollment stays human-led by WhatsApp or call, and the useful proof remains the learner's own artifact.

JSON paid guidance icon

Public

Written lesson stays open

Read the prepare and review material for lesson 08 on the public site before buying anything.

JavaScript paid guidance icon

Recorded

Recorded and live guidance clarify the work

Paid guidance can add founder-led video walkthroughs as they roll out and live online class context; the teaching explains the work, but does not replace the written lesson.

VS Code paid guidance icon

Human

Questions use real context

When stuck, useful guidance starts from the route, error, screenshot, repo fragment, and the lab artifact: Model app data as valid JSON and debug common mistakes.

Phase 1 · Briefing

Lesson briefing

Before You Study (5 mins)

Lesson focus: Whether it's a tweet, a bank balance, a weather report, or a social-media feed, almost all data exchanged between apps on the modern internet travels in one format: JSON. If you can read JSON fluently, you can read the wire-format of essentially every modern API, configuration file, and database export. Today we go past the "JSON is curly braces" framing and into the exact specification — six data types, the parsing rules every parser implements, and the footguns that bite even senior engineers.

What you should have ready:

  • VS Code from Lesson 02 — we'll write JSON files
  • Terminal fluency from Lesson 04 — we'll use node to parse JSON
  • Your Snake game project — we'll move its settings into a config.json
  • A browser open to your game's page — we'll inspect API JSON in DevTools
  • About 50 minutes

The Concept

JSON stands for JavaScript Object Notation. The name is misleading: JSON is a data format, not a programming language, and is supported natively by every major language (Python, Java, Go, Rust, C#, PHP, Ruby, Swift). It was extracted in the early 2000s from JavaScript's literal syntax for objects and arrays, formalized as ECMA-404, and won the wire-format war over XML through one quality: it is small enough to transmit cheaply, and human-readable enough to debug without tools.

The entire JSON specification fits in your head. There are exactly six data types:

TypeExampleNotes
Object{"key": "value"}An unordered collection of string-keyed pairs
Array[1, 2, 3]An ordered list — values can be any of the six types
String"hello"Always double-quoted; supports \n, \t, ÿ escapes
Number42 or 3.14A double-precision IEEE 754 float — no separate int type
Booleantrue or falseLowercase only
NullnullLowercase only

That is the entire data model. There is no "date" type (you encode dates as ISO 8601 strings: "2026-04-29T14:30:00Z"). There is no "binary" type (you encode binary as Base64 strings, which adds ~33% overhead — a real consideration for images and large blobs). There is no separate integer type (large integers above 2⁵³ lose precision in JavaScript — a notorious footgun for finance and timestamp APIs).

The gotchas every JSON-handling engineer hits are worth memorizing once:

  • No comments allowed. A // note in your JSON file makes it invalid. (Some tools support a "JSON with comments" variant — tsconfig.json, .vscode/settings.json — but pure JSON parsers reject them.)
  • No trailing commas. [1, 2, 3,] is invalid. The final element cannot have a comma after it.
  • Keys must be strings. {"42": "answer"} is valid; {42: "answer"} is not.
  • Strings must use double quotes. Single quotes are invalid. 'hello' will fail.
  • No undefined. JavaScript's undefined is not a JSON value. Serializing {a: undefined} drops the key entirely.

The two things JSON does that you'll actually use in this lesson are serialize (turn a JavaScript object into a JSON string) and deserialize (parse a JSON string back into an object):

javascript
const settings = { speed: 10, color: "#22D3EE", arena: "neon" }
const text = JSON.stringify(settings)        // serialize
const back = JSON.parse(text)                // deserialize

Once these two functions click, every API call, every config file, every cross-process message becomes legible.

The reason JSON beat XML for the wire format is partially historical and largely practical. A JSON payload is roughly 30-50% smaller than the equivalent XML for the same data because JSON has no closing tags (XML's <name>...</name> becomes JSON's "name": ...). It parses in less code because the data model maps directly onto JavaScript object literals — and most other languages have followed suit. XML's strengths — namespaces, attributes, schema-inline expressiveness — turn out to matter most for document markup (which is what XML was designed for) and less for the data-interchange use case that came to dominate web traffic.

The deeper reason JSON is durable is composability. A JSON document can contain other JSON documents nested arbitrarily — an array of objects, where each object contains another array, where each item is a string. The same recursive structure encodes a tweet, a directory listing, a database row, a configuration tree, a serialized React component state, a Kubernetes manifest. Once you internalize the six types and the recursion, every JSON document on the internet becomes the same document with different content.

Want the longer story — why JSON beat XML, JSON Schema for validation, JSON-LD for semantic data, and the binary alternatives like Protobuf? The companion article What is JSON and Why Does Every Application Use It is the definitive reference. Read it after this lesson for the historical and architectural context.

Quick Concepts

TermSimple Meaning
JSONThe text data format used by almost every modern API and config file
ObjectThe curly-brace form: {"key": value} — pairs
ArrayThe square-bracket form: [v1, v2, v3] — ordered list
SerializeTurn an in-memory object into a JSON string (JSON.stringify)
Deserialize / ParseTurn a JSON string back into an in-memory object (JSON.parse)
SchemaA separate document defining what shape valid JSON must have

What We Will Build

By the end of this lesson, you will have done these specific things:

  1. Created a new file config.json in your Snake game project with your game settings:
    json
    {
      "gameName": "Super Snake",
      "speed": 10,
      "snakeColor": "#22D3EE",
      "arenaColors": ["#0B0C15", "#151621"],
      "is3D": true,
      "highScores": []
    }
    
  2. Validated your file is well-formed JSON. In the terminal: node -e "console.log(JSON.parse(require('fs').readFileSync('config.json','utf-8')))". If your file has a typo, the error message will tell you the line and column.
  3. Modified your game code to read config.json at startup instead of hardcoding the speed and color. Confirmed the game uses the values from the file.
  4. Changed speed from 10 to 25 in the JSON, reloaded the game, watched the snake move faster — without touching .js code.
  5. Triggered each common JSON parsing error on purpose (so you recognize them when they bite later):
    • Add a trailing comma after "highScores": []. Reload. Watch the parser refuse.
    • Use a single quote: 'gameName': "Super Snake". Reload. Watch the parser refuse.
    • Add a // comment line. Reload. Watch the parser refuse.
    • Fix all three; confirm valid again.
  6. Opened your browser's DevTools (F12 or Cmd+Option+I), Network tab, and inspected the response of any API call your game (or the page) makes. Recognized that everything coming back is JSON.

The point of step 5 is the most important. Hitting each error intentionally once is the fastest way to recognize them when they appear by accident later.

Think About

Before studying, consider:

  1. Two systems written in different languages — say, a Python backend and a JavaScript frontend — need to exchange a list of users. Without JSON (or a similar format), how would they agree on what a "user" looks like over the wire? (Hint: every other approach involves much more code.)
  2. JSON allows nested structures arbitrarily deep. Why is "an array of objects, each with an array of objects" a normal data shape, while "a 7-deep nested object" is usually a code smell? Where is the line?

By the End

After this lesson, you'll:

  • ✅ Know all six JSON data types by heart
  • ✅ Have a working config.json driving your game's settings
  • ✅ Have intentionally triggered the four common JSON errors so you recognize them later
  • ✅ Be able to read JSON in DevTools' Network tab and understand what you're looking at
  • ✅ Know what JSON.stringify and JSON.parse do
  • ✅ Be ready to call APIs in Lesson 09 — because every API response is JSON

The format that runs the data side of the web. Six types and you read it all. 💬

Next lesson · 09

How Apps Talk: APIs Revealed

Call a public API, inspect the response, and connect the idea to how modern applications communicate.

Node.js next lesson iconJSON next lesson iconJavaScript next lesson icon