Skip to content

Manchester | 26-ITP-Sep | Rahana Suleiman| Sprint 1 | Data Groups Coursework - #1493

Open
rahanasuleiman8-ship-it wants to merge 24 commits into
CodeYourFuture:mainfrom
rahanasuleiman8-ship-it:sprint-1
Open

rahanasuleiman8-ship-it wants to merge 24 commits into
CodeYourFuture:mainfrom
rahanasuleiman8-ship-it:sprint-1

Conversation

@rahanasuleiman8-ship-it

@rahanasuleiman8-ship-it rahanasuleiman8-ship-it commented Nov 4, 2026 •

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

Task code

CYF-1071

Changelist

Completed implementation, error handling, and Jest test suites for the Sprint 1 array utility exercises (dedupe, max, mean, sum, and describe-median), including loop refactoring and edge-case validation.

…value, with error handling for invalid inputs
…mpty arrays, negative numbers, decimals, and non-array inputs
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@rahanasuleiman8-ship-it rahanasuleiman8-ship-it added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 4, 2026
@hackertainment hackertainment added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 5, 2026
@hackertainment

Copy link
Copy Markdown

Congratulation, you have completed this PR successfully. Please keep it up.

@hackertainment hackertainment added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Nov 5, 2026
Comment thread Sprint-1/implement/sum.js
Comment on lines +7 to +10
// 2. Handle empty array edge case (sum of empty array is 0)
if (elements.length === 0) {
return 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.

This edge case is actually not needed, because in your algorithm below:

  1. first, line 13 stored 0 into total
  2. then, the for loop will not run due to no item in the elements
  3. as a result, line 21 returns the initial stored 0 (which is the same as line 9).

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