Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js find longest word in string function

function findLongestWordLength(str) {
  return Math.max(...str.split(' ').map(word => word.length));
}
 
PREVIOUS NEXT
Tagged: #js #find #longest #word #string #function
ADD COMMENT
Topic
Name
6+5 =