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

8 lines
178 B
JavaScript

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