Over a million developers have joined DZone.

Array.prototype.sum,max,min

·

Array.prototype.sum = function(){
	for(var i=0,sum=0;i

numeric value only.

[1,2,3].sum() => 6
[1,2,3].max() => 3
[1,2,3].min() => 1
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}