Skip to content

London | 26-ITP-May | Gideon Defar | Sprint 1 | Object Destructuring - #557

Open
gideondefar wants to merge 3 commits into
CodeYourFuture:mainfrom
gideondefar:feature/destructuring
Open

London | 26-ITP-May | Gideon Defar | Sprint 1 | Object Destructuring#557
gideondefar wants to merge 3 commits into
CodeYourFuture:mainfrom
gideondefar:feature/destructuring

Conversation

@gideondefar

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

  • (exercise-1) Updated the parameter in introduceYourself to use object destructuring.
  • (exercise-2) Implemented a function using object destructuring to find the people in Gryffindor house.
  • (exercise-3) Implemented and called printReceipt().

@gideondefar gideondefar added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Flows The name of the module. Core This is a core task and should be completed by all trainees labels Aug 15, 2026
@webmonch webmonch added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 15, 2026
// - In `exercise.js` write a program that will take the `hogwarts` array as input and display the names of the people who belong to the Gryffindor house.
// - Use object destructuring to extract the values you need out of each element in the array.

function findGryffindorMembers(array) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How does the output of this exercise look like?

console.log("");
console.log(`Total: ${totalPrice.toFixed(2)}`);
}
printReceipt(order);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Did you manage to verify that output formatting exactly matches the expected result formatting?


let totalPrice = 0;

for (const { itemName, quantity, unitPricePence } of array) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice! Destructing in the loop header is a very clean solution for this exercise.

@webmonch

Copy link
Copy Markdown

Apart from a few small issues, everything looks solid!

@webmonch webmonch added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 15, 2026
@gideondefar gideondefar added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 15, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 15, 2026
@github-actions

This comment has been minimized.

@gideondefar
gideondefar force-pushed the feature/destructuring branch from b935c88 to de3ab09 Compare August 15, 2026 18:32
@gideondefar gideondefar added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core This is a core task and should be completed by all trainees Module-Data-Flows The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants