ideaped-array-sum
v1.0.0
Published
Calculates the total sum of a specified key across an array of objects
Downloads
3
Readme
Install
Add ideaped-array-sum to your project using npm or yarn.
Install (NPM):
$ npm install ideaped-array-sum --save
Install (Yarn):
$ yarn add ideaped-array-sum
Usage
Import ReduceSum into Your Project
import ArraySum from 'ideaped-array-sum'
Use ArraySum
let products = [{ name: 'Laptop', price: 1000 },{ name: 'Smartphone', price: 500 },{ name: 'Headphones', price: 150 }
];
let totalPrice = ArraySum(products, 'price')
// 1650
Contributing
Pull requests for new features, bug fixes, and suggestions are welcome!