Pls help


#1

var text = ("ey yo its nick crompton and my collars stay poppin, yes i can rap and no im not from compton. england is my CITY")
var myName = ("nick crompton")
var hits = [] 

for(var everydayBro = 0; everydayBro > text.length; everydayBro ++){
    if (text[everydayBro] === "n"){
        for(var i = everydayBro; i > everydayBro + myName.length; i++){
            hits.push(text[j])
        }
    }
    
}

for some reason it isnt pushing it into hits

im probably doing multiple things wrong here

pls halp

forgive my grammar


#2

in both your loop conditions, why the use of >? we should use < given everydayBro starts smaller then text.length, same for second loop


#3

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