Skip to content

Commit d9bfea2

Browse files
committed
Iteration ironhack-labs#1 done
1 parent 03c9f67 commit d9bfea2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

starter-code/src/functions-and-arrays.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
// Iteration #1: Find the maximum
2+
// Iteration #1: Find the maximum
3+
let maxNumber = 0;
4+
function maxOfTwoNumbers(x, y) {
5+
if (x > y) {
6+
maxNumber = x;
7+
console.log(maxNumber);
8+
}
9+
else if (x < y) {
10+
maxNumber = y;
11+
console.log(maxNumber);
12+
}
13+
else {
14+
console.log('The numbers are equal');
15+
}
16+
}
17+
maxOfTwoNumbers(4, 4)
18+
219

320
// Iteration #2: Find longest word
421
const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot'];

0 commit comments

Comments
 (0)