title: Add multiple numbers to Array
body: <p>I have two arrays. They look like this: </p>
  
  <pre><code>array price = 14.60, 39.00
  </code></pre>
  
  <p>and </p>
  
  <pre><code>array quantity = 10, 5
  </code></pre>
  
  <p>(quantity is the quantity of items the user want to buy - 10 items from <code>productA</code> and 5 of <code>productB</code>)</p>
  
  <p>Now I want loop through the variables to multiply the price with the quantity. </p>
  
  <p>Like : </p>
  
  <pre><code>14,60 * 10
  </code></pre>
  
  <p>and</p>
  
  <pre><code>39,00 * 5
  </code></pre>
  
  <p>and add the two results to the <code>endPrice</code> variable.</p>
  
  <p>I get the quantity array like this: </p>
  
  <pre><code>$('.quantity').change(function () {
      quantitys = $('input[type=number]').map(function () {
          return $(this).val();
      }).get();
  });
  </code></pre>
  
  <p>and the different prices like this: </p>
  
  <pre><code>var prices = $('.priceCell').map(function () {
      return parseFloat($(this).html().trim());
  }).get();
  </code></pre>
  
  <p>And that's what I tried: </p>
  
  <pre><code>var endPrice = 0;
  for (var q = 0; q &lt; quantitys.length; q++) {
      for (var p = 0; p &lt; prices.length; p++) {
      endPrice = quantitys[q] * prices[p];
      }
  }
  
  alert(endPrice);
  </code></pre>
  
  <p>Well, that haven't worked for me so well. Can someone help me there? Doesn't matter if the solution is pure JavaScript or jQuery. </p>