title: Array javascript filter
body: <p>I have an array and i want to filter this array by Country and Service</p>
  <p>i did the filter by Country but i want also do the same thing by service</p>
  <p>this the array :</p>
  <pre><code>[
     {
        &quot;Country&quot;:&quot;CHINA&quot;,
        &quot;details&quot;:&quot;None&quot;,
        &quot;Service&quot;:&quot;BUSINESS&quot;,
     },
     {
        &quot;Country&quot;:&quot;USA&quot;,
        &quot;details&quot;:&quot;Bus-Trip&quot;,
        &quot;Service&quot;:&quot;BUSINESS&quot;,
     },
     {
        &quot;Country&quot;:&quot;USA&quot;,
        &quot;details&quot;:&quot;Comm-Trip&quot;,
        &quot;Service&quot;:&quot;COMMUNICATION&quot;,
     },
  
     ];
  </code></pre>
  <p>I was able to do that by this code</p>
  <pre><code>let objectData = Data.reduce(function (acc,cur) {  
      if (!acc[cur.Country])
      acc[cur.Country] =  { data : []};
      acc[cur.Country].data.push(cur)
      return acc;
  },
  {} );
  </code></pre>
  <p>the code above  allowed me to filter only by country and it's work but i want to do this same
  thing by country and service BOTH and i want the result like this :</p>
  <pre><code>
     [
      {
          Country :&quot;CHINA&quot;,
          Service : [
              {&quot;details&quot;:&quot;None&quot;,}
          ] 
         },
         {
          Country :&quot;USA&quot; , 
          Service : [
              {&quot;details&quot;:&quot;Bus-Trip&quot;},
              {&quot;details&quot;:&quot;Comm-Trip&quot;}
          ]
         },
         
     ]
  </code></pre>