Tell us what’s happening:
Hey guys, so I more or less got the outline of my algorithm. I’m just unsure what I could implement in the loop to loop through the values of the array and get the longest string’s length. Do I have to add another loop or an if maybe? I’m just confused atm. Any advice would be helpful!
Thanks in advance for the help!
Regards
Ma3_str0
Your code so far
function findLongestWordLength(str) {
let strArr = str.split();
for(let i = 0;i < strArr.length;i++){
let loopLength = strArr[i].length;
}
}
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:76.0) Gecko/20100101 Firefox/76.0.
Thanks for the response my man I’ll try those steps. When I program in general when solving problems or building a random app, I get impulsive and I improv everything along the way and tinker later. But I’ve been trying to first plan in pseudo lately and it’s been helping me slowly but surely! Thanks again for the reply!