Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

longest word in a string

function findLongestWordLength(str) {
  return Math.max(...str.split(" ").map(word => word.length));
}
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #longest #word #string
ADD COMMENT
Topic
Name
5+7 =