title: Why my filtering and sorting is not working?
body: <p>I have an array of object <code>event</code> where each event has a start date and an end date.</p>
  
  <p>I am trying to filter the events by removing any events that are older than <code>now</code>. Then, I am trying to sort my events as most recent to then display them on the screen.</p>
  
  <p>I am using the following routine:</p>
  
  <pre><code>constructor(props) {
  
      // ..
      this.props.events = this.filterAndSortEvents(props.events);
  }
  
  filterAndSortEvents(events: Object)
  {
      let Original = events;
      const now = new Date();
  
      // filter
      let Filtered = events.map(function(e) {
          if(e.endDate &gt; Date.now())
          { return e }
      });
  
      // sort
      let Sorted = Filtered.sort(function(a,b) {
          return a.startDate &gt; b.startDate ? -1 : a.startDate &lt; b.startDate ? 1 : 0;
      });
  
      return Sorted;
  }
  </code></pre>
  
  <p>But it is not working: </p>