feature/challenge-algorithms #1

Merged
EleonoraOtz merged 11 commits from feature/challenge-algorithms into master 2022-11-01 20:41:51 +00:00
Showing only changes of commit 9b3ac56a7c - Show all commits

View File

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