forked from M3-Academy/challenge-algorithms-v2.0
retornando a maior palavra de um array
This commit is contained in:
parent
64ba560b3c
commit
5aebe7e4f9
@ -1,4 +1,7 @@
|
|||||||
export function longestWords(words) {
|
export function longestWords(words) {
|
||||||
// implementar logica aqui
|
var longest = "";
|
||||||
|
for (var word of words) {
|
||||||
}
|
if (words.length > longest.length) longest = words;
|
||||||
|
}
|
||||||
|
return longest;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user