array-price-total

To sum total price from array

Usage no npm install needed!

<script type="module">
  import arrayPriceTotal from 'https://cdn.skypack.dev/array-price-total';
</script>

README

Price calculation in the array

Install

$ npm i array-price-total

Usage

const arrayTotal = require('array-price-total');

let arr =[
    {   Produc: 'product-1'
        price: '3'
    },
    {
        Produc: 'product-2'
        price: 2
    },
    {
        Produc: 'product-3'
        price: '5'
    }
]

arrayTotal(arr,'price');
//=> 'unicorns & rainbows'