diff --git a/10-longestWords/index.js b/10-longestWords/index.js index a98d2d8..45ede10 100644 --- a/10-longestWords/index.js +++ b/10-longestWords/index.js @@ -1,4 +1,20 @@ export function longestWords(words) { // implementar logica aqui + let long = '' + + const longest = words.map((word) => { + if(word.length > long.length) { + long = word; + } + + return word + + }).filter((word) => { + if(word.length === long.length) { + return word; + } + }); + + return longest } \ No newline at end of file