desafio 10 concluido

This commit is contained in:
Douglas Vinicius Nobrega 2022-10-31 16:38:39 -03:00
parent 70fd2a1c47
commit e4062844a5

View File

@ -1,4 +1,10 @@
export function longestWords(words) {
// implementar logica aqui
}
// implementar logica aqui
let maiorPalavra = "";
for (let i = 0; i < words.length; i++) {
if (words[i].length > maiorPalavra.length) {
maiorPalavra = words[i];
}
}
return words.filter((i) => i.length === maiorPalavra.length);
}