hi there
Running this code to find the longest word in a string
function findLongestWordLength(str) {
let arr= str.split('');
let longest =0;
for( let i =0;i < arr.length;i++){
for(let j=0; j<arr.lenght;j++){
if(arr[j].length >arr[i].length){
longest=arr[j].length;
}
}
}
console.log(longest)
return longest;
}
findLongestWordLength("The quick brown fox jumped over the lazy dog");
my console.log(longest ) is printing 0 which means my value is not being assigned to longest however i’m unsure as to why