title: How to find selected objects from an object
body: <p>I have seasons object and <code>selectedSeasonIds</code> which holds data whether selected key is selected or not. </p>
  
  <p>I'm refactoring the array to object data structure for better performance.</p>
  
  <p>I want to render ONLY selected season while I have these data</p>
  
  <pre><code>seasons  = {30: 'Fall', 31: 'Spring', 32: 'All'}
  
  selectedSeasonIds = {30: true, 31: false, 32: true}
  
  let output = selectedSeasonIds.????
  // {30: 'Fall', 32: 'All'} &lt;- This is my goal
  </code></pre>
  
  <p>I used the selector to select the selected objects. But I don't see any benefit of using it.Please feel free to use my code or create better one. Here is my snippet of my code</p>
  
  <p>Here is my <strong>selector</strong>. </p>
  
  <pre><code>const getSeasons = (seasons, selectedSeasonIds) =&gt; {
    const selectedSeasons = _.filter(
      seasons,
      season =&gt; _.includes(selectedSeasonIds, season.id)
    );
    return selectedSeasons;
  }
  </code></pre>
  
  <p>I'm getting selected objects from selector</p>
  
  <pre><code>selectedSeasons = SelectedSeasonsSelector(this.state) &lt;&lt; getting selector
  if(selectedSeasons.length==0) {
      return '-'
  }
  let seasonList = selectedSeasons.map((season) =&gt; {
      return ' '+season.value;
  })
  return seasonList
  </code></pre>
  
  <p>Thanks!!! </p>