Professional.JavaScript.for.Web.Developers.3rd.Edition.Jan.2012
var value = [1,2,3,4,5]; var sum = value.reduce(function(prev, cur, index, array){ return prev+cur; }); alert(sum);