Sum utility
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
History.md
Makefile
Readme.md
component.json
index.js
package.json

Readme.md

sum

Sum utility

Installation

$ component install component/sum

API

sum(array, [fn|string])

Sum an array of numbers:

sum([1,2,3,4,5]);

Sum properties with callback:

var sum = sum(users, function(user){
  return user.age;
});

map(array, string)

Sum properties in string:

sum(users, 'age');
sum(repos, 'stats.watchers');

License

MIT