Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

map loop

function findLongestWordLength(str) {
  return  Math.max(...str.split(" ").map(word => word.length))
}

findLongestWordLength("The quick brown fox jumped over the lazy dog");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #map #loop
ADD COMMENT
Topic
Name
2+7 =