Tell us what’s happening:
Describe your issue in detail here.
help me find length of a string
Your code so far
function findLongestWordLength(str) {
const words = str.split(" ");
if (words.lenth == 1) {
return words[0].length;
}
return Math.max(
words[0].length,
findLongestWordLength(words.slice(1).join(" "))
);
}
findLongestWordLength("the quick brown fox jumped over the lazy dog");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36
Challenge: Find the Longest Word in a String
Link to the challenge: