javascript function in a for loop not causing crashing browser
<p>I'm new at coding and am trying to figure out why this doesn't work. the function works fine I'm assuming there is a fundamental flaw in the sumArray function that is not processing</p>

<pre><code>// SET UP FUNCTIONS FOR LATER USE   

// sumArray - takes all values within an array and adds them 
var sumArray = function(x){
    var sum = 0;
    for(i=0;i&lt;x.length;i++) {
        sum += parseInt(x[i]);
    };
    return sum;     
};

// create an array and use sumArray function inside of a loop.

// This works
var arrayTest = new Array(1,2,3,4,5,6,7,8,9,10);
document.write (sumArray(arrayTest);

// This crashes the browser
for(i=0;i&lt;10;i++){
document.write("&lt;br/&gt;" + sumArray(arrayTest) + "&lt;br/&gt;"); 
};
</code></pre>

<p>Thanks in advance for any insight.</p>
