Skip to content

Conversation

@wankoak
Copy link

@wankoak wankoak commented Nov 6, 2025

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

  • Fixqed 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

No question

- 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
@wankoak wankoak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 6, 2025
@wankoak wankoak added the 📅 Sprint 1 Assigned during Sprint 1 of this module label Nov 9, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Nov 20, 2025

Can you check if any of this general feedback can help you further improve your code?
https://github.com/CodeYourFuture/Module-Data-Groups/blob/sprint-1-feedback/Sprint-1/feedback.md

Doing so can help reviewers speed up the review process. Thanks.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 20, 2025
@wankoak
Copy link
Author

wankoak commented Nov 20, 2025

@cjyuan thanks for the feedback, I've read the feedback.md and it is really helpful

@wankoak wankoak added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 20, 2025
@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 20, 2025
…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
@wankoak wankoak added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 21, 2025
@wankoak
Copy link
Author

wankoak commented Nov 21, 2025

@cjyuan i made small changes based on your feedback, check them and tell me your feedback if they need fixing

Copy link
Contributor

@cjyuan cjyuan left a 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 cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 21, 2025
@wankoak
Copy link
Author

wankoak commented Nov 21, 2025

@cjyuan thanks a lot, changes wouldn't be great without your eyes-opening feedbacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants