We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d831ae8 commit 3ceb38cCopy full SHA for 3ceb38c
Sprint-1/destructuring/exercise-3/exercise.js
@@ -8,9 +8,11 @@ let order = [
8
];
9
10
function printReceipt(order){
11
- let total = 0 , qtyWidthMax = 3, itemWidthMax = 4
+ let total = 0
12
+ let qtyWidthMax = 3
13
+ let itemWidthMax = 4
14
const receiptLines = order.map(({itemName, quantity, unitPricePence}) => {
- const itemTotalPounds = (quantity*unitPricePence/100);
15
+ const itemTotalPounds = (quantity * (unitPricePence / 100));
16
qtyWidthMax = Math.max(qtyWidthMax, String(quantity).length);
17
itemWidthMax = Math.max(itemWidthMax, itemName.length);
18
return { itemName, quantity, itemTotalPounds };
0 commit comments