Skip to content

Commit b7e564a

Browse files
committed
Iteration ironhack-labs#1: Find the maximum
1 parent 93c90e1 commit b7e564a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<title>LAB | JS Functions & Arrays</title>
88
</head>
99
<body>
10+
1011
<script src="./src/functions-and-arrays.js"></script>
1112
</body>
1213
</html>

src/functions-and-arrays.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
// Iteration #1: Find the maximum
2-
function maxOfTwoNumbers() {}
2+
function maxOfTwoNumbers(number1, number2) {
3+
if(number1 > number2) {
4+
return number1;
5+
}
6+
else if (number1 < number2) {
7+
return number2;
8+
}
9+
else {
10+
return number1||number2;
11+
}
12+
}
313

414

515

0 commit comments

Comments
 (0)