diff --git a/10-longestWords/index.js b/10-longestWords/index.js index a98d2d8..aac5153 100644 --- a/10-longestWords/index.js +++ b/10-longestWords/index.js @@ -1,4 +1,10 @@ export function longestWords(words) { // implementar logica aqui + let longest = "" + for (let word of words){ + if (word.length > longest.length) longest = word; + } + let longest_words = words.filter(item => item.length >= longest.length) + return longest_words } \ No newline at end of file