feat(longestWords): adiciona resolucao questao10-longestwords #10

Merged
carloswinter merged 1 commits from feature/longestWords into development 2022-10-28 19:20:09 +00:00
Showing only changes of commit aec9c86d49 - Show all commits

View File

@ -1,4 +1,14 @@
export function longestWords(words) {
// implementar logica aqui
let newArr = [];
let long = 0;
words.forEach(function(element){
if(element.length > long){
long = element.length
}
});
newArr = words.filter(element =>
element.length == long
);
return newArr;
}