retornando a maior palavra de um array

This commit is contained in:
Carlos cristovao guerreiro scantbelruy 2022-10-28 08:59:53 -04:00
parent 64ba560b3c
commit 5aebe7e4f9

View File

@ -1,4 +1,7 @@
export function longestWords(words) {
// implementar logica aqui
var longest = "";
for (var word of words) {
if (words.length > longest.length) longest = words;
}
return longest;
}