forked from M3-Academy/challenge-algorithms-v2.0
feature/algoritmos #1
@ -1,4 +1,10 @@
|
|||||||
export function longestWords(words) {
|
export function longestWords(words) {
|
||||||
// implementar logica aqui
|
let longWord = "";
|
||||||
|
let word;
|
||||||
|
for(word of words) {
|
||||||
|
if (word.length > longWord.length){
|
||||||
|
longWord = word;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return words.filter((word) => word.length === longWord.length);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user