Skip to content

Instantly share code, notes, and snippets.

@micahasmith
Created December 29, 2011 00:39
Show Gist options
  • Save micahasmith/1530749 to your computer and use it in GitHub Desktop.
Save micahasmith/1530749 to your computer and use it in GitHub Desktop.
multiply all items in an array
var product=function(list) {
var len=list.length,
sum=1,
i=0;
for(;i<len;i+=1) {
sum=sum*list[i];
}
return sum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment