Tell us what’s happening:
**Your code so far**
function findLongestWordLength(str) {
let words = str.split(" ");
let longest = "";
for (let i = 0; i < words.length; i+=1){
let count = words[i];
if (count.length > longest.length){
words = longest;
}
}
return longest.length;
}
console.log(findLongestWordLength("The quick brown fox jumped over the lazy dog"));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36
.
Challenge: Find the Longest Word in a String
Link to the challenge: