From c9a298d9cd487174e9d3f2682103d2ce22d39617 Mon Sep 17 00:00:00 2001 From: devartes Date: Fri, 28 Oct 2022 08:57:42 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20adicionando=20solu=C3=A7=C3=A3o=20do=20?= =?UTF-8?q?10=C2=B0=20desafio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 10-longestWords/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/10-longestWords/index.js b/10-longestWords/index.js index a98d2d8..784e7b0 100644 --- a/10-longestWords/index.js +++ b/10-longestWords/index.js @@ -1,4 +1,5 @@ export function longestWords(words) { // implementar logica aqui - + let maxWord = Math.max(...words.map( elem => elem.length)) + return words.filter(elem => elem.length === maxWord) } \ No newline at end of file