feat(longestWords): algoritmo concluido

This commit is contained in:
Mateus Antonio Rodrigues Lopes 2022-11-02 20:16:40 -03:00
parent b5637169b3
commit 1335638115

View File

@ -1,4 +1,11 @@
export function longestWords(words) { export function longestWords(words) {
// 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);
} }