Skip to content

Instantly share code, notes, and snippets.

@micahasmith
Created December 29, 2011 00:35
sum items in an array
var sum=function(list) {
var len=list.length,
sum=0,
i=0;
for(;i<len;i+=1) {
sum+=list[i];
}
return sum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment