title: Loop Through Nested Object in Node.js
body: <p>Please can someone help or direct me to the write resource on how to solve this. in my node app, i am making an API POST request to access a public flight results. my response data is shown below : </p>
  
  <pre><code> {
      "origin_destinations": [
          {
              "ref_number": "0",
              "direction_id": "0",
              "elapsed_time": "2435",
              "segments": [
                  {
                      "departure": {
                          "date": "2020-05-20",
                          "time": "20:45:00",
                          "airport": {
                              "code": "LOS",
                              "name": "Lagos-Murtala Muhammed Intl, Nigeria",
                              "city_code": "",
                              "city_name": "Lagos",
                              "country_code": "NG",
                              "country_name": "Nigeria",
                              "terminal": "I"
                          }
                      },
                  }
  
              ]
          }
      ]
  
  }
  </code></pre>
  
  <p>as it stands i am finding it difficult accessing the data in the segments Array.</p>