Skip to content

Commit 3a70d55

Browse files
author
Ivan Rubio
committed
1 err intento
1 parent 0f94b74 commit 3a70d55

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/functions-and-arrays.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
// Iteration #1: Find the maximum
2+
/ Iteration #1: Find the maximum
3+
function maxOfTwoNumbers(num1, num2) {
4+
if(num1>num2){
5+
let caja=[num1,num2]
6+
caja.sort()
7+
let bigger=caja[1]
8+
return console.log(bigger)
9+
}
10+
return num2;
11+
}
12+
maxOfTwoNumbers(1,3);
213

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

17+
function findLongestWord(array1){
18+
typeof array1 === ‘null’;
19+
620
// Iteration #3: Calculate the sum
721

822
const numbers = [6, 12, 1, 18, 13, 16, 2, 1, 8, 10];

0 commit comments

Comments
 (0)