How to get sum of array with "for" loop : <p>I'm a total newbie in <code>JavaScript</code>. I'm trying to learn it using programming experience in <code>Python</code>... </p>

<p>Let's say there is an array of integers <code>[2,3,4,5]</code>. I want to get sum of all items in it with <code>for</code> loop. In <code>Python</code> this gonna looks like</p>

<pre><code>list_sum = 0
for i in [2,3,4,5]:
    list_sum += i
</code></pre>

<p>Result is <code>14</code></p>

<p>But if I try same in <code>JavaScript</code>:</p>

<pre><code>var listSum = 0;
for (i in [2,3,4,5])
{
    listSum += i;
}
</code></pre>

<p>This will return <code>00123</code>. Seems that item indexes concatenated in a string with initial <code>listSum</code> value. How to make code works as intended and to get sum of all array items as integer?</p>
