/ Published in: JavaScript
URL: http://evanhahn.com/?p=663
Basically, this creates a string expression of all of the array values added up (eg, 1+2+3) and then evaluates it with eval.
Expand |
Embed | Plain Text
var sum = eval(arrayToSum.join('+'));
You need to login to post a comment.
