From 145f69c047819eea74f14be564c60ac270e406a2 Mon Sep 17 00:00:00 2001 From: Nathalia Sardou Date: Mon, 31 Oct 2022 22:31:44 -0300 Subject: [PATCH] longestWords atualizado c/ erro --- 10-longestWords/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/10-longestWords/index.js b/10-longestWords/index.js index a98d2d8..37bacda 100644 --- a/10-longestWords/index.js +++ b/10-longestWords/index.js @@ -1,4 +1,9 @@ export function longestWords(words) { - // implementar logica aqui - -} \ No newline at end of file + // implementar logica aqui + var longest =""; + for (let word of words) { + if (word.length >= longest.length) longest = word; + } + return longest; + } +