Skip to content

Sheffield | 26-ITP-Jan | Mona -Eltantawy | Sprint 1 | Data- Groups/sprint 1#1076

Open
Mona-Eltantawy wants to merge 14 commits intoCodeYourFuture:mainfrom
Mona-Eltantawy:Module--Data-groups/Sprint-1
Open

Sheffield | 26-ITP-Jan | Mona -Eltantawy | Sprint 1 | Data- Groups/sprint 1#1076
Mona-Eltantawy wants to merge 14 commits intoCodeYourFuture:mainfrom
Mona-Eltantawy:Module--Data-groups/Sprint-1

Conversation

@Mona-Eltantawy
Copy link
Copy Markdown

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

@Mona-Eltantawy Mona-Eltantawy added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 23, 2026
Copy link
Copy Markdown
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.

There is another file in refactor that needs to be updated.

Comment thread Sprint-1/fix/median.js Outdated
Comment thread Sprint-1/implement/max.js Outdated
Comment thread Sprint-1/implement/max.test.js
Comment thread Sprint-1/implement/sum.test.js
@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 Mar 24, 2026
@Mona-Eltantawy Mona-Eltantawy added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 13, 2026
Comment thread Sprint-1/implement/max.js
Comment on lines +1 to 6
function findMax(arr) {
return arr
.filter((item) => typeof item === "number" && Number.isFinite(item));
if(numbers.length=== 0) return null;
return numbers.reduce((acc, num) => (num > acc ? num : acc), -Infinity);
}
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan Apr 13, 2026

Choose a reason for hiding this comment

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

This function is not working as expected. Can you fix it?

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.

I fixed it . Thanks CJ .

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 13, 2026
@Mona-Eltantawy Mona-Eltantawy added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 14, 2026
Copy link
Copy Markdown
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 good.

Comment thread Sprint-1/implement/max.js
.filter((item) => typeof item === "number" && Number.isFinite(item));
if(numbers.length=== 0) return null;
return numbers.reduce((acc, num) => (num > acc ? num : acc), -Infinity);
.filter((item) => typeof item === "number" && Number.isFinite(item))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note: Number.isFinite(item) also checks typeof item === "number"

@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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Apr 14, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants