1function longer(champ, contender) {
2 return (contender.length > champ.length) ? contender : champ;
3}
4
5function longestWord(str) {
6 var words = str.split(' ');
7 return words.reduce(longer);
8}
9
10console.log(longestWord("The quick brown fox jumped over the lazy dogs"));