London | ITP-JAN-2026 | Said Fayaz Sadat | Sprint 1 | coursework/sprint 1#980
Open
fayaz551 wants to merge 5 commits intoCodeYourFuture:mainfrom
Open
London | ITP-JAN-2026 | Said Fayaz Sadat | Sprint 1 | coursework/sprint 1#980fayaz551 wants to merge 5 commits intoCodeYourFuture:mainfrom
fayaz551 wants to merge 5 commits intoCodeYourFuture:mainfrom
Conversation
… acceptance criteria
…e test cases for it to meet acceptance criteria
JaypeeLan
reviewed
Mar 11, 2026
|
|
||
| // Filter only real numbers | ||
| const numbers = list.filter( | ||
| (item) => typeof item === "number" && !isNaN(item) |
There was a problem hiding this comment.
Number.isFinite(item)
Read about isFinite method. It is a btter way to check.
JaypeeLan
reviewed
Mar 11, 2026
|
|
||
| // Filter only numeric values | ||
| const numbers = elements.filter(function (item) { | ||
| return typeof item === "number" && !isNaN(item); |
There was a problem hiding this comment.
read about isFinite, and implement it here.
JaypeeLan
reviewed
Mar 11, 2026
| } | ||
|
|
||
| // Otherwise, return the largest number | ||
| return Math.max.apply(null, numbers); |
There was a problem hiding this comment.
This works, but ES6 is more readable.
Read about rest and spread, and update this line of your code.
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
completed the tasks of sprint-1 of data groups wrote the implementation and jest tests for the functions.
Questions
n/a