title: JavaScript - Printing out each object in array which have same name?
body: <p>So I have an array</p>
  
  <pre><code>var items = [];
  items.push({
      name: "milk",
      id: "832480324"
  });
    items.push({
      name: "milk",
      id: "6234312"
  });
   items.push({
      name: "potato",
      id: "983213"
  });
    items.push({
      name: "milk",
      id: "131235213"
  });
  </code></pre>
  
  <p>Then I have a function <code>order(name, amount)</code>. If I call it like <code>order(milk, 2)</code> then it should show me 2 <code>ID's</code> of milk in the items array. How could I achieve that? (Yeah, I had to make a new question)</p>