forked from M3-Academy/challenge-algorithms-v2.0
12 lines
317 B
JavaScript
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))
|
|
} |