title: how to group array of objects by value in reactjs / javascript
body: <p>I have an array of object that have different values like</p>
  
  <pre><code> items=[{id:1,category:"cat_1" , title:"My title 1"},{id:2,category:"cat_2" , title:"My title 2"},{id:6,category:"cat_1" , title:"Another title 1"},{id:1,category:"cat_3" , title:"My title 3"},{id:8,category:"cat_1" , title:"Third Title"},{id:2,category:"cat_2" , title:"Another title 2 "}]
  </code></pre>
  
  <p>I use array map to list the object and display them as </p>
  
  <pre><code>     {
       items.map((item) =&gt; (
          &lt;h1&gt;{item.category}&lt;/h1&gt;
          &lt;p&gt;{item.title}&lt;/p&gt;
      ))} 
  </code></pre>
  
  <p>My question is how do i iterate the item so as it groups the items by category as follows</p>
  
  <pre><code>cat_1
  - My title 1
  - Another title 1
  - My title 3
  
  cat_2
  - My title 2
  - Another title 2
  
  cat_3
  -Third Title
  </code></pre>