Skip to content

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

HatefEidi
Copy link

@HatefEidi HatefEidi commented Mar 24, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Destructuring arrays and objects

Questions

Ask any questions you have for your reviewer.

@HatefEidi HatefEidi added 📅 Sprint 1 Assigned during Sprint 1 of this module Needs Review Participant to add when requesting review labels Mar 24, 2025
@jenny-alexander jenny-alexander added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Participant to add when requesting review labels Apr 20, 2025
@jenny-alexander jenny-alexander self-requested a review April 20, 2025 21:44
return hogwarts.filter(({ house }) => house === "Gryffindor")
.map(({ firstName, lastName }) => `${firstName} ${lastName}`);
}
console.log(gryffindorMembers(hogwarts));
Copy link

@jenny-alexander jenny-alexander Apr 20, 2025

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));
Copy link

@jenny-alexander jenny-alexander Apr 20, 2025

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) {

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)}`)
Copy link

@jenny-alexander jenny-alexander Apr 20, 2025

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:

  1. The readme does not have the '----------' under the column headers.
  2. The readme file shows a space between the last item and the final total. Can you make this small change?
  3. The readme does not show the item.length being output. Can you update your code to reflect the expected result from the readme?

Copy link

@jenny-alexander jenny-alexander left a 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?

@jenny-alexander jenny-alexander added Needs Review Participant to add when requesting review Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. Needs Review Participant to add when requesting review labels Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review 📅 Sprint 1 Assigned during Sprint 1 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants