-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
London | Phone-Naing | Module-Data-Flows | WEEK-Destructuring-Array #105
base: main
Are you sure you want to change the base?
Conversation
return newOrder.reduce((a,{unitPricePence})=>a+Number(unitPricePence),0).toFixed(2) | ||
|
||
} | ||
console.log(newOrder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've done the core parts of this exercise, but the output format is not the same as the example given in the readme - your result is meant to look exactly like the expected result in the README. Please fix this up :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thanks! done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format isn't quite the same here - in the README everything is is nice neat columns, but in your output there are different spaces between each column...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I used string and padEnd! :) Thanks for reviewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run this now, the items are aligned, but not with the headings:
QTY ITEM TOTAL
1 Hot cakes 2.32
2 Apple Pie 2.78
1 Egg McMuffin 2.80
1 Sausage McMuffin 3.00
2 Hot Coffee 2.00
4 Hash Brown 1.60
Total: 14.50
How could you write your code differently to make sure the headings and items are aligned? And also to make sure that if you changed the headings (or added more space between them), the items would also stay aligned?
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.