Skip to content
This repository

Sum utility

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 History.md
Octocat-spinner-32 Makefile
Octocat-spinner-32 Readme.md
Octocat-spinner-32 component.json
Octocat-spinner-32 index.js
Octocat-spinner-32 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

Something went wrong with that request. Please try again.