sum-by
Sum the elements of an array with an optional iteratee function
Install
npm install sum-by
This module can be used for Node.js as well as browsers using Browserify.
Usage
const _sum = // => 6 // => 4 // => 6 // => 2 // => 0
Tests
npm test
Benchmark
npm run benchmark
Size (uglify + gzip) | Performance | Performance (with iteratee) | |
---|---|---|---|
sum-by | 148 bytes | 56,339,337 ops/sec | 31,280,534 ops/sec |
lodash.sumby | 5,233 bytes | 53,324,787 ops/sec | 16,245,337 ops/sec |
Licence
MIT