milesman34-summation
v1.0.1
Published
A function that emulates the sigma function in math.
Readme
milesman34-summation

Sums the items of an array after applying a given function on each item.
Install
Install with npm:
$ npm install --save milesman34-summationUsage
const summation = require("milesman34-summation");
const array = [3, 2, 7, 4];
summation(array, e => e ** 2);
//78
The first argument for summation must be an array.
The second argument must be a function that operates on an element, similar to what map would use.
