From dfe39deb46b9e9a0bd3dac1a98c9ab54115e6032 Mon Sep 17 00:00:00 2001 From: Rafael Sampaio Date: Fri, 28 Oct 2022 16:54:30 -0300 Subject: [PATCH] feat: solucao longestWords --- 10-longestWords/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/10-longestWords/index.js b/10-longestWords/index.js index a98d2d8..f18a6d4 100644 --- a/10-longestWords/index.js +++ b/10-longestWords/index.js @@ -1,4 +1,5 @@ export function longestWords(words) { - // implementar logica aqui - -} \ No newline at end of file + // implementar logica aqui + let maxLength = Math.max(...words.map((e) => e.length)); + return words.filter((e) => e.length === maxLength); +} -- 2.34.1