Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Array.prototype.sum,max,min

DZone's Guide to

Array.prototype.sum,max,min

·
Free Resource

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:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}