-
-
Notifications
You must be signed in to change notification settings - Fork 221
Birmingham | 25-ITP-Sept | Khor Biel | Sprint 1 | module-data-group/sprint-1 #819
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
Conversation
- Fix calculateMedian to handle sorting, filtering, and edge cases - Implement dedupe to remove duplicates while preserving order - Implement findMax to find maximum number ignoring non-numerics - Implement sum to calculate total ignoring non-numerics - Fix test files by replacing test.todo with proper test implementations
|
Can you check if any of this general feedback can help you further improve your code? Doing so can help reviewers speed up the review process. Thanks. |
|
@cjyuan thanks for the feedback, I've read the feedback.md and it is really helpful |
…tering - Only keep finite numeric values using Number.isFinite() - Remove redundant [...numbers] clone since .filter() already creates a new array - Add clearer comments about non-mutation and sorting behavior - Preserve expected behaviour: return null for invalid or empty numeric inputs
- Use typeof === "number" and Number.isFinite to keep only actual finite numbers - Remove unnecessary .map(Number) after filtering - Return -Infinity when no numeric values are present - Add defensive guard for non-array inputs
- Filters array to keep only real numbers - Returns -Infinity when no numbers are present - Preserves behavior for decimals, negatives, and mixed arrays
…ber tests - Filter now only includes finite numbers - Decimal sums use toBeCloseTo for precision - Removed duplicate or meaningless tests
- Replace index-based loop with a clearer for...of loop - Return false early for non-array inputs to avoid runtime errors - Keep behaviour identical: returns true if target found, otherwise false
|
@cjyuan i made small changes based on your feedback, check them and tell me your feedback if they need fixing |
cjyuan
left a comment
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.
Changes look great. Well done!
|
@cjyuan thanks a lot, changes wouldn't be great without your eyes-opening feedbacks. |
Self checklist
Changelist
No question