Skip to content

Instantly share code, notes, and snippets.

@dtchepak
Created January 24, 2013 06:08
Show Gist options
  • Save dtchepak/4618055 to your computer and use it in GitHub Desktop.
Save dtchepak/4618055 to your computer and use it in GitHub Desktop.
sum = function(xs) {
var total = 0;
for (var i=0; i<xs.length; i++) {
total += xs[i];
}
return total;
}
********************
sum = foldl' (+) 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment