Merge branch 'feature/10-longestWords' into developer

This commit is contained in:
Matheus Mariosa 2022-11-02 13:38:12 -03:00
commit dd43ee9294

View File

@ -1,4 +1,17 @@
export function longestWords(words) {
// implementar logica aqui
let loop = 0;
let newWords = [];
for (let index = 0; index < words.length; index++) {
if (words[index].length > loop) {
loop = words[index].length
}
}
for (let index = 0; index < words.length; index++) {
if (loop === words[index].length) {
newWords.push(words[index])
}
}
return newWords;
}