forked from M3-Academy/challenge-algorithms-v2.0
14 lines
328 B
JavaScript
14 lines
328 B
JavaScript
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;
|
|
} |