What is JSON?
JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format. Despite its name, JSON is language-independent and is supported by virtually every modern programming language.
Advantages
- Human-readable and easy to write
- Lightweight - smaller file sizes than XML
- Native JavaScript support
- Widely supported in APIs and databases
- Simple syntax with minimal overhead
Limitations
- No comments support
- No date/time data type
- Strict syntax (no trailing commas)
- No schema validation built-in
- Limited data types
JSON Syntax Example
{
"name": "John Doe",
"age": 30,
"isActive": true,
"email": null,
"address": {
"city": "New York",
"country": "USA"
},
"tags": ["developer", "designer"]
}JSON Data Types
String
Number
Boolean
Null
Array
Object