feature/algorithms #1

Merged
Vitor_soares merged 10 commits from feature/algorithms into master 2022-10-28 23:12:43 +00:00
Showing only changes of commit d49e9fbdf8 - Show all commits

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
}