feat: Soluciona o exercício 10

This commit is contained in:
Eleonora Otz de Mendonça Soares 2022-11-01 11:55:33 -03:00
parent 32e2c086e3
commit 9b3ac56a7c

View File

@ -1,4 +1,19 @@
export function longestWords(words) {
// implementar logica aqui
let longestWord = ''
words.forEach((word) => {
if(word.length > longestWord.length){
longestWord = word
}
});
const longestWords = words.filter((word) => {
if(word.length === longestWord.length){
return word
}
});
return longestWords
}