title: How to access nested data in Arrays and Objects with Javascript
body: <p>I am tring to use react-charts and the object they give as example data looks like this.</p>
  <pre><code>chartData: [
    {
      label: 'Series 1',
      data: [
        [0, 1],
        [1, 2],
        [2, 4],
        [3, 2],
        [4, 7],
      ],
    },
  ],
  </code></pre>
  <p>I want to build my own &quot;data&quot; and replace this temporary data but the whole object of arrays in objects in arrays (Or whatever it is confuses me.</p>
  <p>Can someone explain the nesting here.
  Is it an array of 2 objects <code>label</code> and <code>data and </code>data` is an array of key value pairs. Is that accurate?</p>
  <p>I'm kind of trying something like this...</p>
  <pre><code>   let myData = []
     res.data.payload.forEach(function (item, index) {
        console.log(item, index)
        myData[(index, item.odds)]
     })
     this.setState({ chartData[data]: myData })
  </code></pre>
  <p>Am I even close?</p>
  <p>Thanks</p>