title: Reduce not geting the right values
body: <p>I'm trying to make an array of arrays, where shoud be like:</p>
  <pre><code>{ 
      data: [0, 0, 0], 
      name: '' 
  }
  </code></pre>
  <p>I made a simple code to test may real one and I noted that it is getting <code>-1</code> on data where it should be other numbers.</p>
  <p>So with the code above I should be able to do this:</p>
  <pre><code>0:
  data: (12) [18093941, 18093941, 18093941, 18093941, 18093941, 18093941, 18093941, 18093941, 18093941, 18093941, 18093941, 35554793]
  name: &quot;Fuel&quot;
  </code></pre>
  <p>What I am doing wrong?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const input = [
      {
        Data: '01/01/2009 00:00:00',
        Fuel: '43575070.000',
        Diesel: '5963754.000',
        monthSingle: '01'
      },
      {
        Data: '01/02/2009 00:00:00',     
        Fuel: 'NULL',
        Diesel: '1509490.000',
        monthSingle: '02'
      },
      {
        Data: '01/03/2009 00:00:00',
        Fuel: '21061010.000',
        Diesel: '6887.000',
        monthSingle: '03'
      },
  
      {
        Data: '01/04/2009 00:00:00',
        Fuel: '21061010.000',
        Diesel: '6887.000',
        monthSingle: '04'
      }
    ]
    const MesesOptions = [
      {
        id: 1,
        value: '01',
        label: 'Janeiro',
        sufix: 'Jan'
      },
      {
        id: 2,
        value: '02',
        label: 'Fevereiro',
        sufix: 'Fev'
      },
      {
        id: 3,
        value: '03',
        label: 'Março',
        sufix: 'Mar'
      }
    ]
    const TheOutPut = input.reduce((acc, cur) =&gt; {
      // console.log(acc, cur)
  return [
        {
          name: 'Fuel',
          data: MesesOptions.map((month) =&gt;
            parseFloat(acc.find((x) =&gt; x.name === 'Fuel').data.indexOf(month.id -1)) +
            parseFloat(cur.monthSingle === month.value ? cur.Fuel ?? 0 : 0))
        }
      ]
    }, [
      { name: 'Fuel', data: [] }, { name: 'Aux', data: [0] }
    ]
    )
    console.log(TheOutPut)</code></pre>
  </div>
  </div>
  </p>