Find the Longest Word in a String__Doubt

Tell us what’s happening:
what is wrong with this code? please help me find a bug.
The code works properly for some sentences except this one.

Your code so far

function findLongestWord(str) {
  var a=str.split(' ');
  var{return str1.length;});
  var largest=0;
  for(var i=0;i<b.length-1;i++)

  return largest;

findLongestWord("What if we try a super-long word such as otorhinolaryngology");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0.

Link to the challenge:

Your for loop condition is incorrect.

for(var i=0;i<b.length-1;i++)

You never look at the last element in the array.

thanks for your help!!