📅  最后修改于: 2022-03-11 15:02:09.580000             🧑  作者: Mango
function findLongestWordLength(str) {
let words = str.split(' ');
let maxLength = 0;
for (let i = 0; i < words.length; i++) {
if (words[i].length > maxLength) {
maxLength = words[i].length;
}
}
return maxLength;
}