how to find the longest word in a string sentence javascript code example
Example: js find longest word in string function
function findLongestWordLength(str) {
return Math.max(...str.split(' ').map(word => word.length));
}
function findLongestWordLength(str) {
return Math.max(...str.split(' ').map(word => word.length));
}