title: Uncaught TypeError: Iterator value undefined is not an entry object" Adding filter to map
body: <p>I am trying to iterate through an array of objects to create a new Object that fits my plan ahead better. Everything works fine until I put a if sentence in the map and I have no clue why?</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 TestArray = [{
      value: 0.2,
      Time: '1980',
      Region: 'Oklahoma',
      RegionNumber: '1620',
      validTo: 2017
    },
    {
      value: 0.3,
      Time: '1983',
      Region: 'Oklahoma',
      RegionNumber: '1620',
      validTo: 2017
    },
    {
      value: 0.2,
      Time: '1986',
      Region: 'Oklahoma',
      RegionNumber: '1620',
      validTo: 2017
    },
    {
      value: 0.2,
      Time: '1988',
      Region: 'Oklahoma',
      RegionNumber: '1620',
      validTo: 2017
    },
    {
      value: 0.2,
      Time: '2018',
      Region: 'Oklahoma',
      RegionNumber: '1620',
      validTo: 2017
    }
  ]
  console.log("This works fine:")
  console.log(Object.fromEntries(TestArray.map((item) =&gt; [item["Time"], item["value"]])))
  console.log("but when adding filter it crashes:")
  console.log(Object.fromEntries(TestArray.map((item) =&gt; {
    if (!(parseInt(item["validTo"]) &gt; item["Time"])) {
      [item["Time"], item["value"]]
    }
  })))</code></pre>
  </div>
  </div>
  </p>