Skip to content

London | 26-ITP-Jan | Karla Grajales| Sprint 1 | Data Groups#1033

Closed
Grajales-K wants to merge 34 commits intoCodeYourFuture:mainfrom
Grajales-K:Sprint-1
Closed

London | 26-ITP-Jan | Karla Grajales| Sprint 1 | Data Groups#1033
Grajales-K wants to merge 34 commits intoCodeYourFuture:mainfrom
Grajales-K:Sprint-1

Conversation

@Grajales-K
Copy link
Copy Markdown

@Grajales-K Grajales-K commented Mar 17, 2026

Learners, PR Template

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

Changelist

In this project, I mastered TDD (Test Driven Development) while implementing various functions. I learned different ways to run tests, such as using npm test and npx jest --watch to run specific tests or all of them at once.

I also learned how to transition from a classic for loop to a for...of loop, which is simpler and more readable. I gained experience using array methods like .filter() and .reduce(), working with Math.max(), using the modulo operator (%), and manipulating arrays with the spread operator (...). This has given me a more confident and solid foundation in TDD.

Questions

I noticed that without the compare function (a, b) => a - b, the .sort() method treats numbers as strings (so '110' comes before '20'). Is it considered best practice to always provide a compare function even if we think the data is already clean?

Thank you for your time reviewing my code.

Grajales-K and others added 19 commits February 27, 2026 23:45
…handling empty arrays and cleaning all data that is not number.
Co-authored-by: Joseph Ajayi <ajayi-joseph@users.noreply.github.com>
@Grajales-K Grajales-K added 🏕 Priority Mandatory This work is expected 📅 Sprint 1 Assigned during Sprint 1 of this module 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 Mar 17, 2026
@Grajales-K Grajales-K changed the title London | 26-ITP-Jan | Karla Grajales| Sprint 1 | Data Groups Sprint-1 London | 26-ITP-Jan | Karla Grajales| Sprint 1 | Data Groups Mar 17, 2026
Comment thread Sprint-1/fix/median.js Outdated
Comment thread Sprint-1/fix/median.js Outdated
Comment thread Sprint-1/implement/dedupe.js Outdated
Comment thread Sprint-1/implement/dedupe.test.js
Comment thread Sprint-1/implement/max.test.js
Comment thread Sprint-1/implement/max.js
Comment thread Sprint-1/implement/sum.js
Comment thread Sprint-1/implement/sum.test.js
Comment thread Sprint-1/refactor/includes.js Outdated
@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 19, 2026
@cjyuan
Copy link
Copy Markdown
Contributor

cjyuan commented Mar 19, 2026

I noticed that without the compare function (a, b) => a - b, the .sort() method treats numbers as strings (so '110' comes before '20'). Is it considered best practice to always provide a compare function even if we think the data is already clean?

Have you read the documentation of Array.prototype.sort() on MDN to find out how the function works?
I think AI can also explain why.

I am not sure what you meant by "data is already clean".

@Grajales-K Grajales-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 23, 2026
@Grajales-K Grajales-K requested a review from cjyuan March 23, 2026 16:27
@Grajales-K
Copy link
Copy Markdown
Author

@cjyuan Thank you for your review and am sorry for the delay! I was very sick this weekend with migraine.

I've updated the tests to handle floating-point precision using toBeCloseTo(). I also added edge cases for NaN and Infinity using a data-driven approach to ensure the function is robust

Thank you.

Comment thread Sprint-1/implement/dedupe.test.js
@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 23, 2026
@Grajales-K Grajales-K requested a review from cjyuan March 23, 2026 21:49
@Grajales-K Grajales-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 23, 2026
@cjyuan
Copy link
Copy Markdown
Contributor

cjyuan commented Mar 23, 2026

Changes look good. Well done.

@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 Mar 23, 2026
@illicitonion
Copy link
Copy Markdown
Member

Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it.

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. Module-Data-Groups The name of the module. 🏕 Priority Mandatory This work is expected 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants