Learn Cheatsheet

JSON

Syntax, types, and structure at a glance.

Value Types
"hello" String — always double-quoted
42 / 3.14 Number — integer or float
true / false Boolean — lowercase only
null Null — absence of value
[1, 2, 3] Array — ordered list
{"k": "v"} Object — key-value pairs
Syntax Rules
"key": value Keys must be double-quoted strings
No trailing commas { "a": 1 } ✅ { "a": 1, } ❌
No comments // and /* */ are not valid in JSON
Double quotes only Single quotes are invalid
Common Patterns
{} Empty object
[] Empty array
[{}, {}] Array of objects — most common API response
"2024-01-15" Dates are strings — ISO 8601 recommended