10
I need to get the sum of the items of a array
javascript.
The quantity of these items can easily reach 2,000 items.
The items are of the type int
, no need to test.
ar = [1,3,5,...,2000];
I already have one array
containing the elements, I do not need to take the value in inputs. I want to add the elements of this array
, in a clear and objective way.
That way I’ll be doing it right? I’ll lose using lasso?
for (f=0;f<60;f++)
{
valorSoma = ar[f]+valorSoma;
}
Possible duplicate of Sum Javascript Array
– William Aparecido Brandino
I couldn’t understand the answer.
– durtto