Could you help me in one dumb thing?

Could you help me in one dumb thing?
0
#1
function findLongestWord(str) {
  let m = 0;
  let array = str.split(" ");
  for(var i = 0; i < array.lenght; i++){
    if(array[i].length > array[m].length){
      m = i;
    }
  }
  return array[m].length;
}

findLongestWord("The quick brown fox jumped over the lazy dog");'

//where i missed? Thats retuning 3...
0 Likes

#2

You misspelled length.

1 Like

#3

Oh thank you, i told… dumb thing…

0 Likes