London | 26-ITP-Jan | Karla Grajales| Sprint 1 | Data Groups#1033
Open
Grajales-K wants to merge 20 commits intoCodeYourFuture:mainfrom
Open
London | 26-ITP-Jan | Karla Grajales| Sprint 1 | Data Groups#1033Grajales-K wants to merge 20 commits intoCodeYourFuture:mainfrom
Grajales-K wants to merge 20 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.