javascript how to find the longest word in a list 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));
}