Skip to content

Manchester | 26-ITP-Sep | Mathew Shaibu | Sprint 1 | Feature/destructuring - #598

Open
MattCarolus10 wants to merge 5 commits into
CodeYourFuture:mainfrom
MattCarolus10:feature/destructuring
Open

MattCarolus10 wants to merge 5 commits into
CodeYourFuture:mainfrom
MattCarolus10:feature/destructuring

Conversation

@MattCarolus10

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

I de-structured the code in the exercises

@MattCarolus10 MattCarolus10 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 21, 2026
@ravinder25886 ravinder25886 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 Nov 22, 2026
},
];

hogwarts.forEach(({ firstName, lastName, house }) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just a tip: We could add something similar to the example below. It would make the output easier to understand and help readers follow the code, especially when reviewing the results of each task.
// Task 1
console.log('===========Task 1===========')
hogwarts.forEach(({ firstName, lastName, house }) => {
if (house === "Gryffindor") console.log(${firstName} ${lastName});
});
// Task 2
console.log('===========Task 2===========')
hogwarts.forEach(({ firstName, lastName, pet, occupation }) => {
if (occupation === "Teacher" && pet) console.log(${firstName} ${lastName});
});

);
totalPence += lineTotalPence;
});
console.log("\nTotal:" + (totalPence / 100).toFixed(2));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You've demonstrated a good understanding of JavaScript object destructuring, array iteration, calculations, and string formatting.

I particularly like your approach of working with integer pence to avoid floating-point precision issues.

The solution is clear, readable, and meets all the exercise requirements.

Keep up the great work, and keep practising!

@ravinder25886 ravinder25886 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You've demonstrated a good understanding of JavaScript object destructuring, array iteration, calculations, and string formatting.

I particularly like your approach of working with integer pence to avoid floating-point precision issues.

The solution is clear, readable, and meets all the exercise requirements.

Keep up the great work, and keep practising!

@ravinder25886 ravinder25886 added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants