Merge branch 'feature/longestWords'

This commit is contained in:
Marcela Mathias 2022-11-02 21:45:46 -03:00
commit 1f095e9fa0

View File

@ -1,4 +1,11 @@
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);
}