Javascript Select Element tem uma palavra longa

function longer(champ, contender) {
  return (contender.length > champ.length) ? contender : champ;
}

function longestWord(str) {
  var words = str.split(' ');
  return words.reduce(longer);
}

console.log(longestWord("The quick brown fox jumped over the lazy dogs"));
Borma