Skip to content

London | 26-ITP-Sep | Bartosz Kawiak | Sprint 1 | Destructing Objects - #601

Open
bartoszkawiak wants to merge 3 commits into
CodeYourFuture:mainfrom
bartoszkawiak:destructingBranch
Open

bartoszkawiak wants to merge 3 commits into
CodeYourFuture:mainfrom
bartoszkawiak:destructingBranch

Conversation

@bartoszkawiak

Copy link
Copy Markdown

Learners, PR Template

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

Exercises completed. Object destructing was used in each case.

@bartoszkawiak bartoszkawiak added 📅 Sprint 1 Assigned during Sprint 1 of this module Module-Data-Flows The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 23, 2026
Comment on lines +11 to +19
function receiptPrint(order) {
for (const { itemName, quantity, unitPricePence } of order) {
const itemTotal = (quantity * unitPricePence) / 100;
total += itemTotal;

console.log(quantity, itemName, itemTotal.toFixed(2));
}
console.log(`Total: ${total.toFixed(2)}`);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The de-structuring part is good. However, the output format does not quite match the expected format.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I added the required console.log line to match the output. thanks CJ

console.log(`Total: ${total.toFixed(2)}`);
}

receiptPrint(order);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you check whether calling the same function twice would produce two sets of identical output?

receiptPrint(order);
receiptPrint(order);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

it's checked and fixed. Thank you CJ

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 25, 2026
@bartoszkawiak bartoszkawiak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 25, 2026
@cjyuan

cjyuan commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Did you forget to push your changes or are your responses in "pending" state? I could not see any changes.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 25, 2026
@bartoszkawiak bartoszkawiak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 28, 2026
@cjyuan

cjyuan commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Changes look good.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 28, 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. Module-Data-Flows The name of the module. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants