London | ITP-May-2025 | Sisay Mehari | Module-Data-Flows | Sprint 1- feature/destructuring#226
Closed
sisaymehari wants to merge 2 commits intoCodeYourFuture:mainfrom
Closed
London | ITP-May-2025 | Sisay Mehari | Module-Data-Flows | Sprint 1- feature/destructuring#226sisaymehari wants to merge 2 commits intoCodeYourFuture:mainfrom
sisaymehari wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
…hers-with-pets filter, and formatted takeout receipt using object destructuring
LonMcGregor
reviewed
Jul 28, 2025
LonMcGregor
left a comment
There was a problem hiding this comment.
Good work in this task - I've left a couple of comments where improvements could be made
| ]; | ||
| function getGryffindorStudents(hogwarts) { | ||
| for (const { firstName, lastName, house } of hogwarts) { | ||
| if (house === "Gryffindor") { |
There was a problem hiding this comment.
Remember to be consistent with indentation. Here your for block is missing indentation.
| ]; | ||
| function getGryffindorStudents(hogwarts) { | ||
| for (const { firstName, lastName, house } of hogwarts) { | ||
| if (house === "Gryffindor") { |
There was a problem hiding this comment.
The function is called getGryffindorStudents - you are correctly filtering on house here, is there anything else to filter?
|
great work - you are done with this sprint. you can close this now |
|
Your PR's title isn't in the expected format. Please check its title is in the correct format, and update it. Reason: Sprint part (Module-Data-Flows) doesn't match expected format (example: 'Sprint 2', without quotes) |
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.
Self checklist
Changelist
✅ Completed Work Summary
This batch includes object destructuring practice, filtering arrays with conditions, and formatting console output for clear receipt printing.
🏠 Array Filtering & Object Destructuring
Implemented a function to filter and print names of Gryffindor students using object destructuring.
Added a function to identify and print teachers who have pets by destructuring object properties and applying multiple conditions.
📄 Formatted Receipt Output
Created a receipt printer that logs each item’s quantity, name, and total price using destructuring.
Used string padding and number formatting to align output neatly in columns.
Calculated and printed the grand total of the order with two decimal precision.
🔍 Best Practices & Code Clarity
Ensured function calls to trigger execution after declaration.
Applied concise and clear variable unpacking for better readability.
Emphasized the importance of formatting for human-friendly console logs.
🧪 Testing & Validation
Manually tested all functions against provided sample data arrays.
Confirmed outputs match expected results exactly, including formatting.
Questions
None at the moment.