Search text for your name!


#1


https://codecademy.com/courses/javascript-beginner-en-XEDZA/0/5?curriculum_id=506324b3a7dffd00020bf661#


It keeps give me an error message that my code isn't pushing any values into my hits variable!


Replace this line with your code. 
var text = ('huehd eifjiwef ejfbwieu formciso wiuehau cenbdciue Antonio okfiorehf Antonio iawhndiuqhuiebn qwiodnxawiu wdiuawBIU Antonio akjbwhdxwbiujehcni uejnc Antonio');
var myName = ('Antonio');
var hits = []

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


#2

That should be text[j].

Don't forget to increment j in your loop paramaters.


#3

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