Skip to content

Commit edae928

Browse files
committed
Updated the code based on reviewers feedback.
1 parent e73d8b2 commit edae928

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎Sprint-1/destructuring/exercise-1/exercise.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const personOne = {
66

77
// Update the parameter to this function to make it work.
88
// Don't change anything else.
9-
function introduceYourself(name, age, favouriteFood) {
9+
function introduceYourself({ name, age, favouriteFood }) {
1010
console.log(
1111
`Hello, my name is ${name}. I am ${age} years old and my favourite food is ${favouriteFood}.`
1212
);

‎Sprint-1/destructuring/exercise-3/exercise.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let order = [
77
{ itemName: "Hash Brown", quantity: 4, unitPricePence: 40 },
88
];
99

10-
console.log("QTY".padEnd(8) + "ITEM".padEnd(20) + "TOTAL");
10+
console.log("QTY".padEnd(8) + "ITEM".padEnd(20) + "TOTAL".padStart(8));
1111

1212
let total = 0;
1313

@@ -17,7 +17,9 @@ order.forEach(({ itemName, quantity, unitPricePence }) => {
1717
total += lineTotal;
1818

1919
console.log(
20-
`${quantity}`.padEnd(8) + itemName.padEnd(20) + lineTotal.toFixed(2)
20+
`${quantity}`.padEnd(8) +
21+
itemName.padEnd(20) +
22+
lineTotal.toFixed(2).padStart(8)
2123
);
2224
});
2325

0 commit comments

Comments
 (0)