From 5e63b3c3a2ff7d8c6c61e1c568780fa153af86ad Mon Sep 17 00:00:00 2001 From: Rhayllon Date: Sun, 30 Oct 2022 03:11:50 -0300 Subject: [PATCH] Feat(Desafio_2.10): Cria resposta desafio 2.10 --- 10-longestWords/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/10-longestWords/index.js b/10-longestWords/index.js index a98d2d8..aac5153 100644 --- a/10-longestWords/index.js +++ b/10-longestWords/index.js @@ -1,4 +1,10 @@ export function longestWords(words) { // 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 } \ No newline at end of file