Quiz Entry - updated: 2026.06.23
What value types does JSON support, and what notable type is missing?
JSON has six value types — string, number, boolean, null, array, object — and crucially has no date type.
{
"string": "hello",
"number": 42,
"float": 3.14,
"boolean": true,
"nothing": null,
"array": [1, 2, 3],
"object": { "nested": "value" }
}
A few rules matter in practice:
- Numbers carry no quotes —
"plz": 1234, not"1234". Quoting a number turns it into a string, which is a common bug. - Keys are always double-quoted strings —
"name", nevernameor'name'(this is where JSON differs from a JavaScript object literal, which allows bare keys). - No comments — you cannot annotate a JSON document.
The big gotcha is dates. JSON has no date type, so a date like a birthday is stored as a plain string — e.g. "1.1.1980" or the ISO form "2024-01-15" — and your code must parse that string back into a real date object (in JavaScript, new Date(...)). Forgetting this and treating the string as a date is a classic source of bugs.
Tip: Prefer the ISO 8601 form ("2024-01-15T10:30:00Z") for dates in JSON — it's unambiguous and sorts correctly as text, unlike 1.1.1980.