Skip to content

ITP-Jan 2025 | London | Chi Mbah | Module-Data-Flows | Week 10 | Sprint 1 | Array Destructuring #191

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

Conversation

Chi-Mb
Copy link

@Chi-Mb Chi-Mb commented Apr 11, 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

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@Chi-Mb Chi-Mb added the Needs Review Participant to add when requesting review label Apr 11, 2025
@jenny-alexander jenny-alexander self-requested a review April 21, 2025 01:28
@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 21, 2025
console.log("QTY ITEM TOTAL");

let total = 0;

Choose a reason for hiding this comment

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

It's best practice to declare variables that are not reassigned as 'const' instead of 'let'.
Can you review your variable declarations that are not reassigned and change them to const?

Here is a video you can watch: https://youtu.be/RE6qf3As-XU?si=_YaiEPeBC5Cx_j56


console.log("Gryffindor Members:");

hogwarts.forEach(({ firstName, lastName, house }) => {

Choose a reason for hiding this comment

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

This works really well! 👏
Something you can do (only a suggestion) is to use .filter to only keep the records where house === "Gryffindor", before .forEach.
This will make your code more concise.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter

(The same could be done to filter and only keep teachers who have pets in task 2 below)

@jenny-alexander jenny-alexander added Needs Review Participant to add when requesting review 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 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants