Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to find the longest string in given string using js

function longestWordLength(str) {
  return Math.max(...str.split(' ').map(word => word.length));
}
Source by www.samanthaming.com #
 
PREVIOUS NEXT
Tagged: #find #longest #string #string #js
ADD COMMENT
Topic
Name
9+3 =