Fastest way to calculate the sum of array elements
<p>I'm trying to find the fastest way to calculate the sum of elements contained in an array.<br>
I managed to do it using <code>eval()</code>, but i consider <a href="http://blogs.msdn.com/b/ericlippert/archive/2003/11/01/53329.aspx" rel="nofollow">eval as evil</a>.</p>

<pre><code>var arr = [10,20,30,40,50];
console.log( eval( arr.join('+') ) ); //logs 150
</code></pre>

<h2>Is there a better way to do it other than using a <code>for loop</code> ?</h2>

<p>I was thinking more about something like that, but it doesn't work:</p>

<pre><code>var arr = [10,20,30,40,50];  

console.log( new Number( arr.join('+') ) ); //logs a Number Object  

console.log( new Number( arr.join('+') ).toString() ); //logs NaN
</code></pre>
