forked from M3-Academy/challenge-algorithms-v2.0
feat: 10-lista-palavras-mais-longas
This commit is contained in:
parent
7ac176e0f0
commit
932ab42fa0
@ -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);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user