Tell us what’s happening:
My code works and I get the success pop up, but the code input section does show an error (missing semi-colon) on my sort function. I don’t see any errors, and everything functions properly. Am I missing something here?
Your code so far
function findLongestWord(str) {
var strArray = str.split(" ");
strArray.sort(function(a,b){return b.length-a.length});
return strArray[0].length;
}
findLongestWord("The quick brown fox jumped over the lazy dog");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
.
Link to the challenge: