Answers for "javascript select element have long word"

0

javascript select element have long word

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"));
Posted by: Guest on April-14-2021

Code answers related to "javascript select element have long word"

Code answers related to "Javascript"

Browse Popular Code Answers by Language