-
-
Notifications
You must be signed in to change notification settings - Fork 71
ITP-JAN-25 | WM| Hatef Eidi | Module-Data-Flows | Array Destructuring | Week-1 #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…der along with their quantity, name and price
return hogwarts.filter(({ house }) => house === "Gryffindor") | ||
.map(({ firstName, lastName }) => `${firstName} ${lastName}`); | ||
} | ||
console.log(gryffindorMembers(hogwarts)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would output text explaining what the output is.
console.log('Gryffindor members are:', gryffindorMembers(hogwarts))
.
return hogwarts.filter(({ occupation, pet }) => occupation === "Teacher" && pet) | ||
.map(({ firstName, lastName }) => `${firstName} ${lastName}`); | ||
} | ||
console.log(teachersWithPets(hogwarts)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would output text explaining what the output is.
console.log('Teachers with pets are:', teachersWithPets(hogwarts))
.
@@ -6,7 +6,7 @@ const personOne = { | |||
|
|||
// Update the parameter to this function to make it work. | |||
// Don't change anything else. | |||
function introduceYourself(___________________________) { | |||
function introduceYourself( { name, age, favouriteFood }=personOne) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Try to keep spacing consistent throughout your code. It makes it easier to read and maintain. 🙂
function introduceYourself( { name, age, favouriteFood } = personOne )
`${quantity.toString().padEnd(7)} ${itemName.padEnd(21)} £${totalItem.toFixed(2)}` | ||
); | ||
}) | ||
console.log(`Total: ${total.toFixed(2)}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The readme required output different than what your PR is showing:
- The readme does not have the '----------' under the column headers.
- The readme file shows a space between the last item and the final total. Can you make this small change?
- The readme does not show the item.length being output. Can you update your code to reflect the expected result from the readme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you may have committed the readme file for exercise 3 by mistake. Can you remove it from the PR?
Learners, PR Template
Self checklist
Changelist
Destructuring arrays and objects
Questions
Ask any questions you have for your reviewer.