RivoCode

JavaScript Fundamentals · Working with JSON · Lesson 34 of 48

What is JSON?

Concept

What is JSON?

JSON (JavaScript Object Notation) is a lightweight, text-based format for representing data. It's the standard way APIs send and receive structured data on the web.

Despite the name, JSON is language-independent — nearly every programming language has a library for reading and writing it, which is exactly why it became the universal format for web APIs.

By the end of this lesson
  • Explain the core idea behind What is JSON?.
  • Predict output before running a change.
  • Test one realistic and one unusual input.
  • Use the result to make the next decision.
How to study this page
  1. 1. Read one concept.
  2. 2. Change the example.
  3. 3. Run, compare, and explain.
  4. 4. Complete the challenge below.
Syntax
{
  "key": "value",
  "number": 42,
  "array": [1, 2, 3]
}
ExampleRunnable
{
  "name": "Alex",
  "age": 20,
  "isStudent": true
}
Try it Yourself »
Nested JSON
{
  "name": "Alex",
  "address": {
    "city": "Tashkent"
  }
}
Note: JSON object keys must always be wrapped in double quotes — single quotes and unquoted keys are valid in JavaScript objects, but not in strict JSON.
Self-check before continuing

Without looking at the example, describe what changes when you modify one input in What is JSON?. Then reopen the editor and prove your explanation with a small test.

You are ready to continue when you can predict, test, and explain the result.

Your turn

Write a small JSON object describing a course, with title, level, and totalLessons fields.

Loading editor…

Console

Output will appear here...