json for code example

Example 1: javascript object notation

{
  "first_name": "Taylor",
  "last_name": "Hawkes",
  "age": 31,
  "address": {
    "street": "954 Kazaam Lane",
    "city": "Boulder",
    "state": "CO",
    "postalCode": "80303"
  },
  "emails": [
    {
      "type": "main",
      "number": "[email protected]"
    },
    {
      "type": "secondary",
      "number": "[email protected]"
    }
  ]
}

Example 2: json beautify

fetch('https://fakestoreapi.com/products')
            .then(res=>res.json())
            .then(json=>console.log(json))

Example 3: json beautify

fetch('https://fakestoreapi.com/products/1')
            .then(res=>res.json())
            .then(json=>console.log(json))