I need to get the value of the sum of the items of a array
in JavaScript.
The amount of these items can easily reach 2,000 items.
Items are of type int
, no testing required.
ar = [1,3,5,...,2000];
I already have a array
containing the elements, I do not need to get the value in the inputs . I want to add the elements of this array
, in a clear and objective way.
Is this correct? Will I lose by tying?
for (f=0;f<60;f++)
{
valorSoma = ar[f]+valorSoma;
}