title: how to map through API data when each data array is different
body: <p>I'm trying to map through this API: <a href="https://api.nasa.gov/neo/rest/v1/neo/browse?api_key=DEMO_KEY" rel="nofollow noreferrer">https://api.nasa.gov/neo/rest/v1/neo/browse?api_key=DEMO_KEY</a></p>
  
  <p>and feed data into my state so I can make a google chart, but I'm stuck on how to do a certain part.</p>
  
  <p>At the moment I have this.</p>
  
  <pre><code>state = {
      data: [
               ['name', 'min estimated diameter', 'max estimated diameter'],
      ],
  }
  </code></pre>
  
  <p>then when the page runs my CoponentDidMount() </p>
  
  <pre><code>componentDidMount() {
  axios.get('https://api.nasa.gov/neo/rest/v1/neo/browse?api_key=DEMO_KEY',)
  .then((response) =&gt; { 
  
      const restructuredData = response.data.near_earth_objects.map(({name, estimated_diameter,}) =&gt; 
          [name, estimated_diameter.kilometers.estimated_diameter_min, estimated_diameter.kilometers.estimated_diameter_max]
      )
  
      const joined = this.state.data.concat(restructuredData)
      this.setState({data: joined});
  })
  </code></pre>
  
  <p>this should take the data from the API create an object with the name, <code>minSize</code> and <code>maxSize</code> then add it under my current data state.</p>
  
  <p>All this currently works fine.</p>
  
  <p>The problem is that I also need the planet it orbits around.</p>
  
  <p><a href="https://api.nasa.gov/neo/?api_key=DEMO_KEY#!/rest%2Fv1%2Fneo/browseNearEarthObjects" rel="nofollow noreferrer">this is data schematic for API I retrieve</a></p>
  
  <p>So here is my main problem in close_approach_data : []</p>
  
  <p>I need to retrieve orbiting_body but when I request data from the API only about 10 of the 20 objects have a close_approach_data object with anything in them, the other half is empty.</p>
  
  <p>so google charts won't run because I end up with undefined in the half my objects.</p>
  
  <p>So what can I do to fix it or make it?</p>