forked from M3-Academy/challenge-algorithms-v2.0
Merge pull request 'Feat(Desafio_2.10): Cria resposta desafio 2.10' (#10) from Feature/Desafio_2.10 into develop
Reviewed-on: #10
This commit is contained in:
commit
22b68f6702
@ -1,4 +1,10 @@
|
|||||||
export function longestWords(words) {
|
export function longestWords(words) {
|
||||||
// implementar logica aqui
|
// implementar logica aqui
|
||||||
|
let longest = ""
|
||||||
|
for (let word of words){
|
||||||
|
if (word.length > longest.length) longest = word;
|
||||||
|
}
|
||||||
|
let longest_words = words.filter(item => item.length >= longest.length)
|
||||||
|
return longest_words
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user