Skip to content

Commit

Permalink
introduce the basePrice variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiosilveira committed Aug 20, 2022
1 parent b9e7195 commit 7428c73
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions function.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
function price(order) {
// price is base price - quantity discount + shipping
const basePrice = order.quantity * order.itemPrice;
return (
order.quantity * order.itemPrice -
Math.max(0, order.quantity - 500) * order.itemPrice * 0.05 +
Expand Down

0 comments on commit 7428c73

Please sign in to comment.