14 lines
263 B
JavaScript
14 lines
263 B
JavaScript
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);
|
|
|
|
} |