Skip to content

Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 1 | Module data group/sprint 1a - #1285

Open
meneogbemi42-bit wants to merge 12 commits into
CodeYourFuture:mainfrom
meneogbemi42-bit:Module-data-Group/sprint-1a
Open

Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 1 | Module data group/sprint 1a#1285
meneogbemi42-bit wants to merge 12 commits into
CodeYourFuture:mainfrom
meneogbemi42-bit:Module-data-Group/sprint-1a

Conversation

@meneogbemi42-bit

Copy link
Copy Markdown

Self checklist

this PR core implementation shows how to Fixe and implement array utility functions with robust error handling:

median – Filters numbers, sorts, and returns middle value (or average for even-length arrays)
dedupe – Removes duplicates using Set
max – Finds maximum numeric value
sum – Totals numeric values
All handle edge cases (empty arrays, mixed types, null/undefined) and include comprehensive test coverage.

@meneogbemi42-bit meneogbemi42-bit added 🏕 Priority Mandatory This work is expected Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. labels Jul 23, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still some things to work on carried over from previous PR

Comment thread Sprint-1/fix/median.js Outdated
}

const salaries = [10, 40, 50, 70, 90];
const median = calculateMedian(salaries);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still need to move these tests away from the implementation into the testing file.

Comment thread Sprint-1/implement/max.js Outdated
if (numbersOnly.length === 0) {
return -Infinity;
}
return Math.max(...numbersOnly);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my original comment from the other PR - is it possible to implement this without using the build in max function?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it is possible, i was just using a short cut method, but i have used the loop function instead of the build in max function

Comment thread Sprint-1/implement/sum.js Outdated
(item) => typeof item === "number" && !isNaN(item)
);

if (numbersOnly.length === 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you answer my comment from the original PR - When is this if condition needed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after commenting the if function out i saw it was not really need. the test till passed without it. i added it because i thought it will deal with with returuning the empty arrey value.

@LonMcGregor LonMcGregor 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 Jul 27, 2026
@meneogbemi42-bit meneogbemi42-bit 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 Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-Groups The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants