challenge-algorithms-v2.0-n.../10-longestWords/index.js

12 lines
317 B
JavaScript

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