title: Sum of arrays inside for loop
body: <p>I'm trying to get sum of each array inside for loop.
  My code now is something like this</p>
  <pre><code>for (var i = 1; i &lt; 6; i++) {
      (function(i) {
          if ($(&quot;.brand_name-&quot;+i).length &gt; 0 ) {
              
              Array_new = parseInt ($(&quot;.price-&quot; + i).text());
              someArray = $.trim (Array_new);
              var total = 0;
              for (var k = 0; k &lt; someArray.length; k++) {
                  total += someArray[k] &lt;&lt; 0;
              }
  
              console.log(total);
          }
  </code></pre>
  <p>and HTML version of elements is</p>
  <pre><code>&lt;strong class=&quot;product_price_send price-3&quot;&gt;88.87&lt;/strong&gt;
  &lt;strong class=&quot;product_price_send price-5&quot;&gt;8.78&lt;/strong&gt;
  &lt;strong class=&quot;product_price_send price-5&quot;&gt;48.78&lt;/strong&gt;
  </code></pre>
  <p>Problem is - its not showing sum of elements. Perhaps i need one more for loop inside for loop for an array?</p>