forked from M3-Academy/challenge-algorithms-v2.0
Develop #1
@ -1,4 +1,10 @@
|
||||
export function longestWords(words) {
|
||||
// implementar logica aqui
|
||||
|
||||
let longestSize = 0
|
||||
let longestWord = []
|
||||
words.forEach(element => {
|
||||
if(element.length>longestSize)
|
||||
{longestSize = element.length}})
|
||||
longestWord = words.filter(element => element.length === longestSize);
|
||||
return longestWord
|
||||
}
|
Loading…
Reference in New Issue
Block a user