Answers for "find biggest word in the string"

1

find biggest word in the string

function findLongestWordLength(str) {
  let words = str.split(' ');
  let maxLength = 0;

  for (let i = 0; i < words.length; i++) {
    if (words[i].length > maxLength) {
      maxLength = words[i].length;
    }
  }

  return maxLength;
}
Posted by: Guest on April-17-2021

Code answers related to "find biggest word in the string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language