feat: 10-lista-palavras-mais-longas

This commit is contained in:
Adilson Fernando Neves Ornellas 2022-10-29 17:33:13 -03:00
parent 7ac176e0f0
commit 932ab42fa0

View File

@ -1,4 +1,12 @@
export function longestWords(words) { export function longestWords(words) {
// implementar logica aqui // implementar logica aqui
let longest = '';
} for (const word of words) {
if (word.length > longest.length) {
longest = word;
}
}
return words.filter((word) => word.length === longest.length);
}