Merge pull request 'feat(longestWords): adiciona resolucao questao10-longestwords' (#10) from feature/longestWords into development

Reviewed-on: #10
This commit is contained in:
Carlos Eduardo T. Winter 2022-10-28 19:20:08 +00:00
commit 9aa41cfe2c

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;
}