-
Trailing Comma: A comma after the last item in an object or array. This is a common mistake that is not allowed in JSON.
Incorrect:
`{ "name": "Alice", "age": 30, }`
Correct:
`{ "name": "Alice", "age": 30 }`
-
Missing Double Quotes on Keys: All keys must be strings and must be enclosed in double quotes.
Incorrect:
`{ name: "Alice" }`
Correct:
`{ "name": "Alice" }`
-
Single Quotes: The JSON specification requires double quotes for all string values and keys. Single quotes are not allowed.
Incorrect:
`{ 'name': 'Alice' }`
Correct:
`{ "name": "Alice" }`
-
Missing Commas: Items in an array or key-value pairs in an object must be separated by a comma.
Incorrect:
`{ "name": "Alice" "age": 30 }`
Correct:
`{ "name": "Alice", "age": 30 }`