title: Javascript compare two arrays in map function
body: <p>I have two arrays and I'm trying to make a list which is like,</p>
  
  <p>what fruits John, Gaby have got? list. xD</p>
  
  <p>John and Gaby have their own id each and compare those two ids to the Array, Fruits. when fruitId matches to John or Gaby's juiceId, Its John or Gaby's fruits.</p>
  
  <p>John : apple, orrange</p>
  
  <p>Gaby : mango</p>
  
  <pre><code>Fruits = [
    {fruitId: 'abc', name: 'apple'},
    {fruitId: 'abc', name: 'orange'},
    {fruitId: 'def', name: 'mango'},
    {fruitId: 'egt', name: 'pineapple'}
  ]
  
  Juices = [
    {juiceId: 'abc', customer: 'John'},
    {juiceId: 'def', customer: 'Gaby'}
  ]
  </code></pre>
  
  <p>I think it would be something like this??</p>
  
  <pre><code>array.map((list) =&gt; {
     &lt;div&gt;// customer's name {list.customer}&lt;/div&gt;
     &lt;div&gt;// fruit's name {list.name}&lt;/div&gt;
  })
  </code></pre>