-
-
Notifications
You must be signed in to change notification settings - Fork 283
London | 26-ITP-Jan | Karla Grajales| Sprint 1 | Data Groups #1033
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
Closed
Closed
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
90372b6
feat: add a function to pass the array of number, positives and negat…
Grajales-K 9575183
feat: implement immutable sorting using spread operator for median ca…
Grajales-K 7f1e727
feat: add validation for empty or non-array input in median calculation
Grajales-K 9e447e7
feat: enhance median calculation by filtering non-numeric values and …
Grajales-K bb34f14
feat: add data validation and non-numeric filtering to median calcula…
Grajales-K 0db6d2e
refactor: cleaning the function and leave only the reusable code
Grajales-K 7591135
test: add unit tests for dedupe function with various input scenarios
Grajales-K efb99b9
feat: implement deduplication function to remove duplicate values fro…
Grajales-K 5da81e2
refactor: remove unnecessary check for empty array in dedupe function
Grajales-K 799078c
refactor: simplify dedupe function by removing unnecessary conditiona…
Grajales-K 169e5b7
test: add unit tests for max function covering various input scenarios
Grajales-K 38450fd
feat: add validation for empty input and filter non-numeric values in…
Grajales-K 8875c3e
refactor: simplify findMax function by filtering non-numeric values
Grajales-K f45cbf4
test: add unit tests for sum function covering various input scenarios
Grajales-K 88e8c1b
test: fix expected assertions in unit tests for sum function
Grajales-K b490a39
feat: implement sum function with filtering for non-numeric values
Grajales-K 9e3e2a9
refactor: simplify sum function by combining filtering and sum the nu…
Grajales-K e33e09c
refactor: improve test readability and consistency in includes tests
Grajales-K 4718ab3
refactor: simplify includes function by using for...of loop
Grajales-K 2b09a9b
Merge branch 'main' into Sprint-1
Grajales-K 57e4e97
refactor: optimize median calculation by removing unnecessary array s…
Grajales-K b3838b5
refactor: clean up median function by improving number filtering logic
Grajales-K 19331eb
fix: add new name parameter for better readability
Grajales-K aa28437
refactor: enhance dedupe test for clarity and ensure input immutability
Grajales-K 788a622
refactor: improve number filtering logic in findMax function to exclu…
Grajales-K 71807f7
test: add cases to validate findMax function handling of NaN values
Grajales-K c317ce7
fix: use prettier for indentation
Grajales-K 5eb205b
test: add cases to validate sum function handling of NaN and Infinity…
Grajales-K 31d489d
refactor: improve sum function to exclude NaN values during calculation
Grajales-K 1d9349d
fix: use toBeCloseTo for floating point precision and handle edge cases
Grajales-K 8116813
test: add edge cases for sum function to handle floating point precision
Grajales-K d529f18
fix: update input data for aoc-2018-day1 to correct values
Grajales-K c55acc1
fix: dedupe test for clarity and ensure input immutability
Grajales-K 4e2a405
fix: test ignore no numeric values
Grajales-K File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,10 @@ | ||
| function dedupe() {} | ||
| /** | ||
| * Deduplicates an array of elements (strings, numbers, etc.) | ||
| * @param {Array} items - The array containing potential duplicates | ||
| */ | ||
|
|
||
| function dedupe(items) { | ||
| return [...new Set(items)]; | ||
| } | ||
|
|
||
| module.exports = dedupe; |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,11 @@ | ||
| // 1. filter: leep only elements that are onlyNumbers. | ||
| // 2. spread (...) take the numbers out of the Array | ||
| // 3. Math.max find the largest number and return -infinity if empty. | ||
|
|
||
| function findMax(elements) { | ||
| const onlyNumbers = elements.filter((element) => typeof element === "number" && !Number.isNaN(element)) | ||
| return Math.max(...onlyNumbers); | ||
| } | ||
|
Grajales-K marked this conversation as resolved.
|
||
|
|
||
| module.exports = findMax; | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,10 @@ | ||
| function sum(elements) { | ||
| return elements.reduce( | ||
| (acc, curr) => | ||
| typeof curr === "number" && !Number.isNaN(curr) ? acc + curr : acc, | ||
| 0 | ||
| ); | ||
| } | ||
|
Grajales-K marked this conversation as resolved.
|
||
|
|
||
| module.exports = sum; | ||
|
|
||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.