Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

WM5 | Sariat Adenike | Module-JS2 | Week-1 #77

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
using for loop and if statement to test
  • Loading branch information
sariat0001 committed Nov 9, 2023
commit cc496d9e4d9894a5b128ca6e9ab0d2cce3f6e549
6 changes: 6 additions & 0 deletions week-1/implement/max.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@ function max(list) {
const maxNumber = [];
if (list.length === 0) {
return "-Infinity";
} else {
for (const item of list) {
if (typeof item === "number") {
maxNumber.push(item);
}
}
}
}