Skip to content

Commit 0366da9

Browse files
committed
Iteration ironhack-labs#1: Find the maximum
1 parent 0f94b74 commit 0366da9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/functions-and-arrays.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
// Iteration #1: Find the maximum
22

3+
function maxOfTwoNumbers(a, b) {
4+
if(a > b) {
5+
return a
6+
} else {
7+
return b
8+
}
9+
}
10+
311
// Iteration #2: Find longest word
412
const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot'];
513

0 commit comments

Comments
 (0)