Skip to content

London | 26-ITP-Jan | Abdul Moiz | Sprint 1 | Object Destructing#382

Open
A-Moiz wants to merge 3 commits intoCodeYourFuture:mainfrom
A-Moiz:feature/destructuring
Open

London | 26-ITP-Jan | Abdul Moiz | Sprint 1 | Object Destructing#382
A-Moiz wants to merge 3 commits intoCodeYourFuture:mainfrom
A-Moiz:feature/destructuring

Conversation

@A-Moiz
Copy link

@A-Moiz A-Moiz commented Feb 28, 2026

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

Changelist

  • Completed exercise 1
  • Completed exercise 2
  • Completed exercise 3

Questions

For exercise 3, I used padStart() and padEnd() to match the formatting in the README file. If there is an easier alternative please let me know. Thanks.

@A-Moiz A-Moiz added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 28, 2026
@ykamal ykamal 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 Mar 17, 2026
Copy link

@ykamal ykamal left a comment

Choose a reason for hiding this comment

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

Well done 👍 Looks good to me. Left a few comments as well.

function introduceYourself(___________________________) {
function introduceYourself({ name, age, favouriteFood }) {
console.log(
`Hello, my name is ${name}. I am ${age} years old and my favourite food is ${favouriteFood}.`
Copy link

Choose a reason for hiding this comment

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

Well done!
This is the way

function orderReceipt({ quantity, itemName, unitPricePence }) {
let total = ((unitPricePence * quantity) / 100).toFixed(2);
console.log(
String(quantity).padEnd(9),
Copy link

Choose a reason for hiding this comment

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

This is good. You can also do number.toString().padEnd(9) or such as most data types have a toString() method to parse that value as a string.

);
}

console.log("QTY".padEnd(10) + "ITEM".padEnd(20) + "TOTAL".padEnd(20));
Copy link

Choose a reason for hiding this comment

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

Just curious, is the goal to print out like this in the console? Or can you also use console.table() ?

@ykamal ykamal added Reviewed Volunteer to add when completing a review with trainee action still to take. 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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 17, 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