Given a sentence, find the length of the longest word in it.
Returns the length of the longest word in the provided sentence.
The return value should be a number.
Use split() to split each word in the sentence into an array and compare the longest words.
function findLongestWord(str) { var s=str.split(" "); var len=0; for(i=0;i<s.length;i++){ if(s[i].length>len){ len=s[i].length; } } return len; } findLongestWord("The quick brown fox jumped over the lazy dog");