forked from M3-Academy/challenge-algorithms-v2.0
Merge pull request 'feat(desafio10):desafio-completo' (#10) from feature/desafio10 into develop
Reviewed-on: #10
This commit is contained in:
commit
640b397803
@ -1,4 +1,14 @@
|
|||||||
export function longestWords(words) {
|
export function longestWords(words) {
|
||||||
// implementar logica aqui
|
// 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;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user