feat(longestWords): funcao feita

This commit is contained in:
Nicolly Vieira Santos Costa 2022-10-28 15:14:45 -03:00
parent 74a08c52c7
commit 447575f0be

View File

@ -1,4 +1,12 @@
export function longestWords(words) {
// implementar logica aqui
let numeroDeCaractere = 0
words.forEach((word) => {
if (word.length >= numeroDeCaractere) {
numeroDeCaractere = word.length
}
})
return words.filter((palavra) => (palavra.length == numeroDeCaractere))
}