London | 26-ITP-Jan | Abdul Moiz | Sprint 1 | Object Destructing#382
Open
A-Moiz wants to merge 3 commits intoCodeYourFuture:mainfrom
Open
London | 26-ITP-Jan | Abdul Moiz | Sprint 1 | Object Destructing#382A-Moiz wants to merge 3 commits intoCodeYourFuture:mainfrom
A-Moiz wants to merge 3 commits intoCodeYourFuture:mainfrom
Conversation
ykamal
approved these changes
Mar 17, 2026
ykamal
left a comment
There was a problem hiding this comment.
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}.` |
| function orderReceipt({ quantity, itemName, unitPricePence }) { | ||
| let total = ((unitPricePence * quantity) / 100).toFixed(2); | ||
| console.log( | ||
| String(quantity).padEnd(9), |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
Just curious, is the goal to print out like this in the console? Or can you also use console.table() ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Learners, PR Template
Self checklist
Changelist
Questions
For exercise 3, I used
padStart()andpadEnd()to match the formatting in the README file. If there is an easier alternative please let me know. Thanks.