Find the longest word in a string challenge on Fcc

Dear team,

pls i am having issues with challenge: Basic Algorithm Scripting: Find the Longest Word in a String

findLongestWordLength(“The quick brown fox jumped over the lazy dog”) should return a number.

findLongestWordLength(“The quick brown fox jumped over the lazy dog”) should return 6.

findLongestWordLength(“May the force be with you”) should return 5.

findLongestWordLength(“Google do a barrel roll”) should return 6.

findLongestWordLength(“What is the average airspeed velocity of an unladen swallow”) should return 8.

findLongestWordLength(“What if we try a super-long word such as otorhinolaryngology”) should return 19.

i used the code below and it didnt work but when i tried it on the console of my browser it worked perfectly…pls what do i do

function findLongestWord(str) {
  var strSplit = str.split(" ");
  var longestWord = 0;
  for(var i = 0; i < strSplit.length; i++){
    if(strSplit[i].length > longestWord){
	longestWord = strSplit[i].length;
     }
  }
  return longestWord;
}
findLongestWord("The quick brown fox jumped over the lazy dog");

6// this was the returned answer

Add the link to the challenge.

Also, if don’t use Internet Explorer. It’s known to cause problems for people doing these challenges.

what i pasted here was the guide that i looked at before trying to solve the challenge…but i have tried it with the correct function name and it didnt work before copying the guide to know if the problem was from me…

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string

this is mine and this cansolve the challenge:

function findLongestWordLength(str) {
 var strSplit = str.split(" ");
  var longestWord = 0;
  for(var i = 0; i < strSplit.length; i++){
    if(strSplit[i].length > longestWord){
	longestWord = strSplit[i].length;
     }
  }
  return longestWord;
}
findLongestWordLength("The quick brown fox jumped over the lazy dog");

it only pass the the first condition of the challenge

i have seen my error,i did: var strSplit = str.split(""); instead of: var strSplit = str.split(" ");

but the code is working now sir

thanks for your insight