Skip to content

Conversation

@AjueborChukwuemeke
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

In this PR I learned about working more with arrays.
I learned about mixing for loops with if statements to return desired results for a function.

Questions

Ask any questions you have for your reviewer.

@AjueborChukwuemeke AjueborChukwuemeke added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 16, 2025
@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Module-Data-Groups) doesn't match expected format (example: 'Sprint 2', without quotes)

1 similar comment
@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Module-Data-Groups) doesn't match expected format (example: 'Sprint 2', without quotes)

@AjueborChukwuemeke AjueborChukwuemeke changed the title Manchester | ITP-May-2025 | Chukwuemeke Ajuebor | Module-Data-Groups | Sprint-1 Manchester | ITP-May-2025 | Chukwuemeke Ajuebor | Sprint | Data-Groups Aug 17, 2025
@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint) doesn't match expected format (example: 'Sprint 2', without quotes)

@AjueborChukwuemeke AjueborChukwuemeke changed the title Manchester | ITP-May-2025 | Chukwuemeke Ajuebor | Sprint | Data-Groups Manchester | ITP-May-2025 | Chukwuemeke Ajuebor | Sprint | Data-Groups-Arrays Aug 17, 2025
@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint) doesn't match expected format (example: 'Sprint 2', without quotes)

@AjueborChukwuemeke AjueborChukwuemeke changed the title Manchester | ITP-May-2025 | Chukwuemeke Ajuebor | Sprint | Data-Groups-Arrays Manchester | ITP-May-2025 | Chukwuemeke Ajuebor | Sprint 1 | Data-Groups-Arrays Aug 17, 2025
@LonMcGregor LonMcGregor 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 Aug 18, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Good work on this sprint. I have left comments on some files for you to think about.

Also, did you mean to commit the prep folder?

const nums = list.filter(x => typeof x === 'number' && !isNaN(x));
if (nums.length === 0) return null;

const sorted = [...nums].sort((a, b) => a - b);

Choose a reason for hiding this comment

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

Why are you expanding an array into an array here? Can you think of a way to simplify this?

const middleIndex = Math.floor(sorted.length / 2);
let median;
if (sorted.length % 2 !== 0) {
median = sorted.slice(middleIndex, middleIndex + 1)[0];

Choose a reason for hiding this comment

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

Think about when you want to use slicing to access arrays, and what you are trying to do here. Is there a way to get a value from an array that might be better suited than slicing for this line of code?


// Given an array with both positive and negative numbers
// When passed to the max function
// Then it should return the largest number overall

Choose a reason for hiding this comment

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

I think you may have misunderstood what the program specification is asking for here. Try to think about what your understanding is generally - does your code behave consistently when given mixed numbers and only negative numbers?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants