A comprehensive guide to learning how JSON works, how nested objects are structured, and how to verify whether values are placed correctly inside deeply nested schemas.
JSON stands for JavaScript Object Notation. It is a lightweight format used for storing and exchanging data.
JSON powers APIs, cloud platforms, web applications, mobile apps, automation systems, SIEMs, configuration files, and modern software infrastructure.
{
"name": "David",
"age": 20,
"student": true
}
| Type | Description | Example |
|---|---|---|
| String | Text inside quotes | "hello" |
| Number | Integer or decimal | 42 |
| Boolean | true or false | true |
| Array | Ordered collection | [1,2,3] |
| Object | Key-value structure | {"name":"David"} |
| null | Empty value | null |
Objects use curly braces and contain key-value pairs.
{
"username": "network_admin",
"role": "administrator",
"active": true
}
Arrays store ordered lists of values.
{
"ports": [80, 443, 22, 21]
}
Nested schemas contain objects inside other objects, creating hierarchical structures.
{
"company": {
"name": "CyberTech",
"location": {
"country": "Costa Rica",
"city": "San Jose"
}
}
}
company
│
├── name
└── location
├── country
└── city
Thinking visually helps understand hierarchy and placement.
One of the most important real-world JSON skills is verifying whether values exist in the correct hierarchy.
{
"server": {
"network": {
"ip": "192.168.1.10"
}
}
}
Correct Path:
server.network.ip
{
"users": [
{
"permissions": {
"admin": true
}
}
]
}
Correct path:
users[0].permissions.admin
Schemas define the expected structure and data types.
{
"user": {
"id": "number",
"name": "string"
}
}
{
"response": {
"data": {
"user": {
"profile": {
"username": "david-marin-0xff"
}
}
}
}
}
response.data.user.profile.username
{
name: "David"
}
{
"name": "David",
}
{
"infrastructure": {
"datacenter": {
"servers": [
{
"hostname": "srv-web-01"
}
]
}
}
}
{
"device": {
"network": {
"interfaces": [
{
"name": "eth0",
"ip": "192.168.0.15"
}
]
}
}
}
{
"application": {
"database": {
"credentials": {
"username": "admin"
}
}
}
}
application.database.credentials.username
| Feature | JSON | JavaScript Object |
|---|---|---|
| Requires Quotes | Yes | No |
| Supports Functions | No | Yes |
| Supports Comments | No | Yes |
const jsonData = `{
"name": "David"
}`;
const parsed = JSON.parse(jsonData);
console.log(parsed.name);
const user = {
name: "David"
};
const converted =
JSON.stringify(user, null, 4);
{
"cloud": {
"regions": [
{
"instances": [
{
"security": {
"firewall": true
}
}
]
}
]
}
}
cloud.regions[0].instances[0].security.firewall