Skip to content

Commit d91c479

Browse files
committed
Finished iteration ironhack-labs#2
1 parent 7dc48d0 commit d91c479

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/functions-and-arrays.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ function maxOfTwoNumbers(numberOne, numberTwo) {
1010
}
1111

1212
// Iteration #2: Find longest word
13-
const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot'];
13+
// const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot'];
1414

15-
function findLongestWord() {
15+
function findLongestWord(words) {
1616
if (words.length === 0) {
1717
return null
1818
} else if (words.length === 1) {
19-
return words
19+
return words[0]
2020
} else if (words.length > 1) {
2121
words.sort(function (a, b) {
2222
if (a.length < b.length) return 1; // 1 here (instead of -1 for ASC)

0 commit comments

Comments
 (0)