Make an array filled with numbers 1 to 10000 and then sum all of those numbers
<p>How can I turn this into a function that takes an array of any length and gives you the total?</p>

<pre><code>var points = new Array(100);
for (var i = 0; i &lt; 100; i++) {
    points[i] = i + 1; 
}

for(var i = 0; i &lt; points.length; i++) {
    console.log(points[i]); 
}
</code></pre>