diff --git a/10-longestWords/index.js b/10-longestWords/index.js index a98d2d8..a5dc5c1 100644 --- a/10-longestWords/index.js +++ b/10-longestWords/index.js @@ -1,4 +1,12 @@ export function longestWords(words) { // implementar logica aqui - + let lista = []; + words.forEach(palavra => { + if(!lista[0] || lista[0].length < palavra.length){ + lista = [palavra] + } else if(lista[0].length == palavra.length){ + lista.push(palavra) + } + }); + return lista; } \ No newline at end of file