forked from M3-Academy/challenge-algorithms-v2.0
9 lines
311 B
JavaScript
9 lines
311 B
JavaScript
export function longestWords(words) {
|
|
// implementar logica aqui
|
|
let longestSize = 0
|
|
words.forEach(element => {
|
|
if(element.length>longestSize){
|
|
longestSize = element.length}})
|
|
let longestWord = words.filter(element => element.length === longestSize);
|
|
return longestWord
|
|
} |