Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Mgphone
Copy link

@Mgphone Mgphone commented Dec 30, 2024

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@Mgphone Mgphone added the Needs Review Participant to add when requesting review label Dec 30, 2024
@illicitonion illicitonion added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Participant to add when requesting review labels Dec 30, 2024
Sprint-1/destructuring/exercise-1/exercise.js Outdated Show resolved Hide resolved
Sprint-1/destructuring/exercise-2/exercise.js Outdated Show resolved Hide resolved
Sprint-1/destructuring/exercise-2/exercise.js Outdated Show resolved Hide resolved
return newOrder.reduce((a,{unitPricePence})=>a+Number(unitPricePence),0).toFixed(2)

}
console.log(newOrder)
Copy link
Member

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 :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure thanks! done

Copy link
Member

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...

Copy link
Author

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

Copy link
Member

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?

@illicitonion illicitonion added Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants