Skip to content

ITP-JAN-LONDON|FOROGH AGHAEIYARIJANI|MODULE-DATA-FLOWS|SPRINT 1|DESTRUCTURING|problem-solving-destructuring #179

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 1 commit into
base: main
Choose a base branch
from

Conversation

Forogh-Aghaeiyarijani
Copy link

@Forogh-Aghaeiyarijani Forogh-Aghaeiyarijani commented Apr 3, 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

Implemented object destructuring in function parameters and within array iterations.

Added logic to:

Print names of Gryffindor members from the hogwarts array.

Print names of teachers with pets.

Generate a formatted receipt using object destructuring and computed totals.

Ensured output formatting matches the expected result for all tasks.

Questions

Ask any questions you have for your reviewer.

@Forogh-Aghaeiyarijani Forogh-Aghaeiyarijani added the Needs Review Participant to add when requesting review label Apr 3, 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 22:20
// Task1: Display names of people in Gryffindor
console.log("Gryffindor Members:");
hogwarts.forEach(({ firstName, lastName, house }) => {
if (house === "Gryffindor") {

Choose a reason for hiding this comment

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

Your code works well 👍
Non-blocking suggestion: If you wanted to improve clarity, you can use .filter to only include records where house === 'Gryffindor' before running .forEach.


// Task2: Display names of teachers who have pets
console.log("\nTeachers with Pets:");
hogwarts.forEach(({ firstName, lastName, occupation, pet }) => {

Choose a reason for hiding this comment

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

Your code works well 👍
Non-blocking suggestion: If you wanted to improve clarity, you can use .filter to only include records where occupation === 'Teacher' && pet before running .forEach.

@jenny-alexander jenny-alexander added Complete Participant to add when work is complete and review comments have been addressed and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Apr 21, 2025
@jenny-alexander
Copy link

Please make sure to update the Changelist section of the PR with a short explanation of your changes.
Screenshot 2025-04-20 at 8 50 42 PM

@jenny-alexander jenny-alexander added Reviewed Volunteer to add when completing a review and removed Complete Participant to add when work is complete and review comments have been addressed labels Apr 21, 2025
@Forogh-Aghaeiyarijani Forogh-Aghaeiyarijani added the Complete Participant to add when work is complete and review comments have been addressed label Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Participant to add when work is complete and review comments have been addressed Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants