feat: finalizado longestWords

This commit is contained in:
Vitor Soares 2022-10-28 17:12:14 -03:00
parent b4852810c4
commit d49e9fbdf8

View File

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