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