Tell us what’s happening:
Your code so far
function findLongestWordLength(str) {
var large = str.split('');
var largee = 0 ;
for(var i = 0; i < large.length; i++){
if(large[i].length > largee){
largee = large[i].length;
}
}
return largee;
}
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/77.0.3865.120 Safari/537.36
.
Challenge: Find the Longest Word in a String
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string