Skip to content

London | ITP-May-2025 | Jamal Laqdiem| Module-Data-Groups | Sprint 1 #557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

jemaljemy
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_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@jemaljemy jemaljemy added the Needs Review Participant to add when requesting review label Jul 5, 2025
@fearcyf fearcyf self-assigned this Jul 7, 2025
@fearcyf fearcyf added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Participant to add when requesting review labels Jul 7, 2025
Copy link

Choose a reason for hiding this comment

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

Tests passed, well done. Could your approach be more succinct? Research test.each

Copy link
Author

Choose a reason for hiding this comment

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

done. thanks for reviewing.

Copy link

Choose a reason for hiding this comment

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

Tests passed, well done

Copy link
Author

Choose a reason for hiding this comment

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

thanks for reviewing.

Copy link

Choose a reason for hiding this comment

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

Test passed, well done

Copy link
Author

Choose a reason for hiding this comment

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

thanks for reviewing.

Copy link

Choose a reason for hiding this comment

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

Code works fine, just one consideration, do you really need lines 4-6. It's not an error just consider it.

Copy link
Author

Choose a reason for hiding this comment

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

you are right, even if with an if statement will get an early exit if the list is empty does not change much as the for..of loop handle this as well. thanks for reviewing.

Copy link

Choose a reason for hiding this comment

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

sense checked the code - looks fine. This should work providing relevant file is available. Consider how you would code to catch and handle an error ( for example a file not being available). Just something to think about./research

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for reviewing, I will do.

@fearcyf
Copy link

fearcyf commented Jul 7, 2025

A few points to consider, overall good work.

@fearcyf fearcyf added Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 7, 2025
@jemaljemy jemaljemy added the Needs Review Participant to add when requesting review label Jul 7, 2025
@fearcyf
Copy link

fearcyf commented Jul 8, 2025

Jamal, it says that your branch has conflicts to be resolved. Have a look at this.

@jemaljemy
Copy link
Author

I'm trying from last night to get the issue of median.test.js file who is doing this, still trying to rebase.

Copy link
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

This is generally looking good, but sometimes a bit more complicated than it could be. Please take a look at my comments and update your code or reply to them with thoughts!

@@ -1,4 +1,27 @@
function findMax(elements) {
if (elements.length === 0) {
Copy link
Member

Choose a reason for hiding this comment

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

What are you guarding against with this if statement? If you removed it, what would break in your code?

Copy link
Author

Choose a reason for hiding this comment

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

thanks for reviewing, this if statement check in case of empty array will return -infinity as requested, it would return an incorrect and misleading result for an empty array.

Copy link
Member

Choose a reason for hiding this comment

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

What result would it return for an empty array, if you removed this special case? Read through the code line-by-line and try to work it out.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for reviewing, after examining the code again i can clearly notice that the if condition in the line 2 is redundant, as the for loop handle that case and return -infinity.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good! If you push a change fixing this, we can call this PR complete :)

@illicitonion illicitonion removed the Needs Review Participant to add when requesting review label Jul 17, 2025
@jemaljemy jemaljemy added Needs Review Participant to add when requesting review 📅 Sprint 1 Assigned during Sprint 1 of this module labels Jul 18, 2025
@illicitonion
Copy link
Member

Please respond to all comments before requesting review again - it's ok to respond by changing code, or by replying to them with an answer.

@illicitonion illicitonion removed the Needs Review Participant to add when requesting review label Jul 18, 2025
@jemaljemy
Copy link
Author

Thanks for taking time to review, from my side it look like I answered to your 4 comments, I may be missing something, could you please specify what is missing.
much appreciated.

@jemaljemy jemaljemy added the Needs Review Participant to add when requesting review label Jul 18, 2025
@illicitonion
Copy link
Member

Sorry, I can't see any answers - is it possible you have some comments pending, or some code changes you haven't pushed to your remote?

I see these comments without answers:

Screenshot 2025-07-21 at 11 22 35

And this is the only code I see having changed since I left those comments, which only answers one of the comments:

Screenshot 2025-07-21 at 11 23 01

@jemaljemy
Copy link
Author

I had to submit the comments from file changed, as they were pending.

Copy link
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

I'm glad we could work that out, thanks! Just one comment left to work through :)

@@ -1,4 +1,27 @@
function findMax(elements) {
if (elements.length === 0) {
Copy link
Member

Choose a reason for hiding this comment

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

What result would it return for an empty array, if you removed this special case? Read through the code line-by-line and try to work it out.

@illicitonion illicitonion removed the Needs Review Participant to add when requesting review label Jul 22, 2025
@jemaljemy jemaljemy added the Needs Review Participant to add when requesting review label Jul 23, 2025
@illicitonion illicitonion added Complete Volunteer to add when work is complete and review comments have been addressed and removed Needs Review Participant to add when requesting review Reviewed Volunteer to add when completing a review labels Jul 23, 2025
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 review comments have been addressed 📅 Sprint 1 Assigned during Sprint 1 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants