The Format

Six types and that is all of it. String, number, boolean, null, array, object. There is nothing else in JSON.

No comments. No trailing commas. No single quotes. Keys are always double-quoted strings. Most JSON errors people hit are one of those four rules.

Two absences that matter.

No date type. Dates arrive as strings, usually ISO 8601 like "2026-08-15", and converting them is your job. Sorting them as text happens to work for that format, which is exactly why people do it without noticing they got lucky.

No integer versus float. There is one number type, and very large numbers can lose precision. That is why serious APIs send identifiers as strings, and why you should keep them as strings.

EXAMPLE
loading editor…

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: Reading a Response Safely →
← Back