Few examples of JSON data structures

 Here are a few examples of JSON data structures commonly used in web development:

Simple Object:

{
  "name": "John Doe",
  "age": 30,
  "email": "johndoe@example.com"
}

Array of Objects:

[
  {
    "name": "John Doe",
    "age": 30,
    "email": "johndoe@example.com"
  },
  {
    "name": "Jane Smith",
    "age": 25,
    "email": "janesmith@example.com"
  },
  {
    "name": "Mike Johnson",
    "age": 35,
    "email": "mikejohnson@example.com"
  }
]


Nested Objects:

{
  "name": "John Doe",
  "age": 30,
  "email": "johndoe@example.com",
  "address": {
    "street": "123 Main St",
    "city": "New York",
    "country": "USA"
  }
}
Array of Nested Objects:
json
Copy code
[
  {
    "name": "John Doe",
    "age": 30,
    "email": "johndoe@example.com",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "country": "USA"
    }
  },
  {
    "name": "Jane Smith",
    "age": 25,
    "email": "janesmith@example.com",
    "address": {
      "street": "456 Elm St",
      "city": "Los Angeles",
      "country": "USA"
    }
  }
]
These examples demonstrate different JSON structures such as a simple object with key-value pairs, an array of objects, nested objects, and arrays of nested objects. 

Leave a Reply

Your email address will not be published. Required fields are marked *