feat(longestWords): Implementa função longestWords #10

Merged
Daniel_Moliari_Barbosa merged 1 commits from feature/longestWords into development 2022-10-28 19:26:42 +00:00

View File

@ -1,4 +1,16 @@
export function longestWords(words) {
// implementar logica aqui
let long = 0;
let longWords = [];
for(let i = 0;i < words.length;i++){
if(words[i].length >= long){
long = words[i].length;
}
}
for(let j = 0;j < words.length;j++){
if(words[j].length == long){
longWords.push(words[j]);
}
}
return longWords;
}