Strings are Enclosed in Double Quotes:Keys and string values must be enclosed in double quotes.
{
"name": "Alice"
}Numbers:JSON supports both integers and floating-point numbers.
{
"age": 25,
"price": 2.99
}Booleans: JSON represents true and false values as true and false (without quotes).
{
"isStudent": true
}Null: JSON uses null (without quotes) to represent a null or empty value.
{
"city": null
}Whitespace: JSON ignores whitespace characters (like spaces and line breaks) outside of strings. However, it’s recommended to format JSON for readability.
Nesting: You can nest objects and arrays within each other to create complex data structures.
{
"person": {
"name": "Bob",
"age": 35
},
"hobbies": ["reading", "hiking"]
}