title: How to filter emails list by domains and count it in JavaScript?
body: <p>I got emails and domains lists. I need to take only domains from domains list and count it. Here is short example of arrays and function countDomains:</p>
  
  <pre><code>const emails = ['info@gmail.com','info@hotmail.com','admin@host.com','felix@hotmail.com','alex123@host.com'];
  const domains = ['gmail.com','hotmail.com'];
  
  const countDomains = (emails) =&gt; {
  result = emails
    .filter(email =&gt; domains.includes(email.split('@')[1]))
    .reduce((acc, email) =&gt; {
      acc[email] = (acc[email] === domains.includes(email.split('@')[1]));
      return acc;
      }, {});
   return result;    
  }
  console.log(countDomains(emails));
  </code></pre>
  
  <p>I have trouble with this line:
  <code>acc[email] = (acc[email] === domains.includes(email.split('@')[1]));</code>
  just have no idea how to write this. can any one help?</p>