-
-
Notifications
You must be signed in to change notification settings - Fork 153
London | ITP-May-2025 | Sisay Mehari | Module-Data-Groups | Sprint 1 #556
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?
London | ITP-May-2025 | Sisay Mehari | Module-Data-Groups | Sprint 1 #556
Conversation
modified: Sprint-1/implement/dedupe.js modified: Sprint-1/implement/dedupe.test.js modified: Sprint-1/implement/max.js modified: Sprint-1/implement/max.test.js modified: Sprint-1/implement/sum.js modified: Sprint-1/implement/sum.test.js modified: Sprint-1/refactor/includes.js modified: Sprint-1/stretch/aoc-2018-day1/solution.js
modified: Sprint-1/fix/median.js
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.
tests passed, well done
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.
Tests passed, well done
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.
Tests passed, well done
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.
code looks fine
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.
consider how you would code to catch errors such as file not being available. just a consideration, w3 schools is a website with good information
I can't see your median.tests file, please advise. Otherwise good work |
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.
This would work, well done
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.
Each type of error can be identified and returned however that should be discussed later in the course. Do your own research in the meantime.
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.
Tests passed, well done
I have made the changes. Can you please tag the complete label? |
Sisay, I have now added the Complete Tag. @cjyuan, this sprint 1 should be ready to go forward now. |
Thank you. |
Learners, PR Template
Self checklist
Changelist
✅ Completed Work Summary
This pull request includes completed implementations and refactors across several array utility functions, with full test coverage and a stretch challenge solution from Advent of Code.
📦 Core JavaScript Functions
Removes duplicate values from arrays while preserving order.
Tests cover:
Empty arrays
Arrays with and without duplicates
Arrays with mixed types (e.g., strings, numbers)
Finds the maximum numeric value in an array, ignoring non-numeric entries.
Improved handling for:
Empty arrays (returns -Infinity)
Arrays with only non-numeric values
Negative and decimal numbers
Calculates the sum of numeric values in an array, skipping non-numeric values.
Tested with:
Empty arrays
Arrays with negative and decimal numbers
Arrays with only non-number elements
Computes the median of numeric values in an array.
Enhancements include:
Skips non-numeric values
Returns null for empty or invalid arrays
Added comments and sample I/O for clarity
Rewrote the includes function to use a more readable for...of loop instead of a traditional for loop.
All original tests still pass.
🚀 Stretch Goal: Advent of Code 2018 - Day 1
solution.js
Implements calculateFrequency(changes) to compute resulting frequency from a list of changes like +1, -2, etc.
Starts from frequency 0
Handles input from file
Ensures all deltas are processed correctly
🧪 Testing
Comprehensive test coverage added for all updated and new functions.
Tests include:
Edge cases (e.g., empty arrays, invalid inputs)
Common use cases
Non-numeric filtering and robust input validation
Questions
None at the moment.