-
-
Notifications
You must be signed in to change notification settings - Fork 283
London|26-ITP-January|Alexandru Pocovnicu|Sprint 1|Data Groups #959
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
alexandru-pocovnicu
wants to merge
26
commits into
CodeYourFuture:main
from
alexandru-pocovnicu:Sprint-1
Closed
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
575c939
filtered and sorted a copy of the original list
alexandru-pocovnicu 8ca70c3
Refactor calculateMedian function to handle non-array inputs and impr…
alexandru-pocovnicu 0656e3b
Add test for findMax function to return Infinity for empty array
alexandru-pocovnicu b50166e
Implement findMax function to return the maximum number from an array…
alexandru-pocovnicu 99d1421
Refactor findMax function and add test for handling both positive and…
alexandru-pocovnicu 80d3cb0
Add test for findMax function to handle arrays with only negative num…
alexandru-pocovnicu ef647c6
Update tests for findMax function to include decimal numbers and adju…
alexandru-pocovnicu 3db5d07
Fix findMax function to return -Infinity for empty arrays and update …
alexandru-pocovnicu b0a85a7
Update findMax function to filter out NaN values and add test for non…
alexandru-pocovnicu e2abc3f
Refactor findMax function and tests for improved readability and cons…
alexandru-pocovnicu 573a325
Implement sum function and tests to handle various input scenarios, i…
alexandru-pocovnicu a5a261e
added export module
alexandru-pocovnicu d0a50ce
added parameter to dedupe
alexandru-pocovnicu 6769952
Add test case for dedupe function to handle empty array
alexandru-pocovnicu c10a14f
Add early return for empty array in dedupe function
alexandru-pocovnicu efbcbb5
Add dedupe function logic and test case for arrays without duplicates
alexandru-pocovnicu d5e5142
Refactor dedupe function and add test case for handling duplicates in…
alexandru-pocovnicu 498fa5f
Refactor includes function to use for...of loop for improved readability
alexandru-pocovnicu a8bb981
Refactor includes function to remove unnecessary whitespace for clean…
alexandru-pocovnicu 30584f6
Add solution function to calculate the sum of an array of numbers
alexandru-pocovnicu 06da285
removed redundant code
alexandru-pocovnicu d360571
changed test to check for copy of array and updated the function to p…
alexandru-pocovnicu 8fa3f7c
added logic so that the function returns only the first occurence of …
alexandru-pocovnicu a08d0f4
deleted unnecessary code
alexandru-pocovnicu e5942ef
removed debugging code
alexandru-pocovnicu 8debb23
refactor: change variable declarations to const for filtered and sort…
alexandru-pocovnicu 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,14 @@ | ||
| function dedupe() {} | ||
| function dedupe(arr) { | ||
| if (arr.length === 0) { | ||
| return []; | ||
| } | ||
| let newArr = []; | ||
| for (let element of arr) { | ||
| if (!newArr.includes(element)) { | ||
| newArr.push(element); | ||
| } | ||
| } | ||
| return newArr; | ||
| } | ||
|
|
||
| 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,8 @@ | ||
| function findMax(elements) { | ||
| const filteredElements = elements.filter( | ||
| (x) => typeof x === "number" && !Number.isNaN(x) | ||
| ); | ||
| return Math.max(...filteredElements) | ||
| } | ||
|
|
||
| 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,13 @@ | ||
| function sum(elements) { | ||
| const filteredElements = elements.filter( | ||
| (x) => typeof x === "number" && !Number.isNaN(x) | ||
| ); | ||
|
|
||
| if (filteredElements.length === 0) { | ||
| return 0; | ||
| } | ||
| return filteredElements.reduce((a, b) => a + b); | ||
| } | ||
|
|
||
|
|
||
| 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
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.