function findLongestWordLength(str) {
var splitString=str.split("");
var biggestWord=0;
for(var i=0;i < splitString.length; i++){
if(biggestWord<splitString[i].length){
biggestWord=splitString[i].length;
}
}
return biggestWord;
}
console.log(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; rv:80.0) Gecko/20100101 Firefox/80.0.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.