Skip to content

Commit f3e3d56

Browse files
committed
Iteration ironhack-labs#3 Done
1 parent 835168b commit f3e3d56

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/functions-and-arrays.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,24 @@ function maxOfTwoNumbers(a,b) {
1010
// Iteration #2: Find longest word
1111
const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot'];
1212

13-
function findLongestWord() {}
13+
function findLongestWord(words) {
14+
15+
// condcional y bucle con .lentg
16+
// return longestOne
17+
}
1418

1519

1620

1721
// Iteration #3: Calculate the sum
1822
const numbers = [6, 12, 1, 18, 13, 16, 2, 1, 8, 10];
1923

20-
function sumNumbers() {}
24+
function sumNumbers(numbers) {
25+
totalNumbers= 0;
26+
for (let i=0;i<numbers.length;i++) {
27+
totalNumbers += numbers[i]
28+
}
29+
return totalNumbers;
30+
}
2131

2232

2333

0 commit comments

Comments
 (0)