diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-06-14 16:44:21 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-06-14 16:44:21 -0400 |
| commit | b1600adec47a04f60e1da07d94a3ed3906ff5aee (patch) | |
| tree | 828f786da6806d7237ee5cbc5df61e552353b85b /frontend/lib/calcTotalPrice.js | |
| parent | a95e08cd2dd5d7ec0a0412adae02515a5f9cec4f (diff) | |
starter files
Diffstat (limited to 'frontend/lib/calcTotalPrice.js')
| -rw-r--r-- | frontend/lib/calcTotalPrice.js | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/frontend/lib/calcTotalPrice.js b/frontend/lib/calcTotalPrice.js deleted file mode 100644 index 4822468..0000000 --- a/frontend/lib/calcTotalPrice.js +++ /dev/null @@ -1,6 +0,0 @@ -export default function calcTotalPrice(cart) { - return cart.reduce((tally, cartItem) => { - if (!cartItem.item) return tally; - return tally + cartItem.quantity * cartItem.item.price; - }, 0); -} |
