feat(longestWords): algoritmo concluido
This commit is contained in:
parent
b5637169b3
commit
1335638115
@ -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);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user