Your second "for" loop, I am going mad


#1

Went through a lot of topics here, didn't find similar issues with my code. Going mad, still can't find what's wrong. The message says that for loop doesn't push value to the array, tried to console.log it, no luck. Super blind..
Thanks in advance

var text = "some text Katya text text";
var myName = "Katya"; 
var hits = [];

for (var i = 0; i > text.length; i++) {
  if (text[i] === 'K') {
        for (var j = i; j < (i + myName.length); j++) {
            hits.push(text[j]);
        }    
      }
    }


#2

i > text.length

did you think it should be run


#3

such a dumb blind mistake :joy::flushed:, huge thanks


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.