aggregate-functions
JavaScript library to get aggregate values of array, namely; SUM, AVG, MAX, MIN, COUNT.
Node.js (Install)
Requirements:
-
Node.js
-
npm (Node.js package manager)
npm i aggregate-functions
Or
npm i aggregate-functions --save
Usage
Modular include:
const aggregateFunctions = ;
Use in method
//for getting SUM of an arraylet sum = aggregateFunctions; //for getting AVG of an arraylet avg = aggregateFunctions; //for getting MAX of an arraylet max = aggregateFunctions; //for getting MIN of an arraylet min = aggregateFunctions; //for getting COUNT/LENGTH of an arraylet count = aggregateFunctions;
### SOME EXAMPLES
let exapmpleArray = 7 20 24 14 2 19 12 //for getting SUM of an array let sum = aggregateFunctions; console;//98 //for getting AVG of an array let avg = aggregateFunctions; console;//14 //for getting MAX of an array let max = aggregateFunctions; console;//24 //for getting MIN of an array let min = aggregateFunctions; console;//2 //for getting COUNT/LENGTH of an array let count = aggregateFunctions; console;//7