Skip to content

Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Data Groups Fix#1002

Open
Richiealx wants to merge 1 commit intoCodeYourFuture:mainfrom
Richiealx:coursework/sprint-1-fix
Open

Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Data Groups Fix#1002
Richiealx wants to merge 1 commit intoCodeYourFuture:mainfrom
Richiealx:coursework/sprint-1-fix

Conversation

@Richiealx
Copy link

Learners, PR Template

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

Completed the Sprint 1 - Fix exercise for the Data Groups module.

Fix: calculateMedian

Fixed the implementation of the calculateMedian function in:

Improvements made

  • Ensured the function correctly calculates the median value of an array
  • Handles both odd and even length arrays
  • Filters out non-numeric values
  • Returns null when no numeric values are present
  • Avoids mutating the original input array
  • Ensures compatibility with the existing Jest tests

Testing

All tests were run locally using:

cd Sprint-1
npm test -- fix

Result:

All tests passed successfully.

@Richiealx Richiealx added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 13, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 13, 2026
@github-actions

This comment has been minimized.

@Richiealx Richiealx changed the title Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Data Groups | Fix Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Data Groups Fix Mar 13, 2026
@Richiealx Richiealx added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant