London | 26-ITP-Jan | Karla Grajales| Sprint 1 | Data Groups#1033
London | 26-ITP-Jan | Karla Grajales| Sprint 1 | Data Groups#1033Grajales-K wants to merge 34 commits intoCodeYourFuture:mainfrom
Conversation
…ives and return the median
…handling empty arrays and cleaning all data that is not number.
Co-authored-by: Joseph Ajayi <ajayi-joseph@users.noreply.github.com>
… findMax function
Have you read the documentation of I am not sure what you meant by "data is already clean". |
|
@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. |
|
Changes look good. Well done. |
|
Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it. |
Learners, PR Template
Self checklist
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.