challenge-algorithms-v2.0/10-longestWords/index.js

9 lines
199 B
JavaScript

export function longestWords(words) {
// implementar logica aqui
var longest ="";
for (let word of words) {
if (word.length >= longest.length) longest = word;
}
return longest;
}