Skip to content

London | 26-ITP-Sep | Mandip Sanger| Sprint 1 | Object destructuring - #583

Open
mandipsanger wants to merge 3 commits into
CodeYourFuture:mainfrom
mandipsanger:Object-Destructuring
Open

mandipsanger wants to merge 3 commits into
CodeYourFuture:mainfrom
mandipsanger:Object-Destructuring

Conversation

@mandipsanger

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

Task code

CYF-1112

Changelist

3 exercise of feature/destructuring

@mandipsanger mandipsanger added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 12, 2026
@webmonch
webmonch self-requested a review September 14, 2026 21:38
@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 Sep 14, 2026
// Task 1
for (const { firstName, house } of hogwarts) {
if (house === "Gryffindor") {
console.log(firstName);

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 compare the output with the one described in readme.md?

// Task 2
for (const { firstName, occupation, pet } of hogwarts) {
if (occupation === "Teacher" && pet) {
console.log(firstName);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same question as above.

const itemTotal = quantity * unitPricePence;

console.log(
`${quantity} ${itemName.padEnd(20)}${(itemTotal / 100).toFixed(2)}`

@webmonch webmonch Sep 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you think this can be made more robust in terms of formatting structure?
Also did you manage to verify if output matches the one defined in readme for this exercise?

@webmonch

webmonch commented Sep 14, 2026

Copy link
Copy Markdown

Good job!

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

Really clean use of destruction in the loop here.

@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 Sep 14, 2026
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 with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants