feat(longestWords): funcao feita #10

Merged
NicollyVieira merged 1 commits from feature/longestWords into development 2022-10-28 18:15:50 +00:00

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))
}