Your second "for" loop


#1

Please please please tell me what I have done wrong.
I literally can't find it...

/*jshint multistr:true */

text = "If it hadn't been for Cotton-Eye Joe \
I'd be married long time ago \
Where did you come from? \
Where did you go? \
Where did you come from Cotton-Eye Joe?";

var myName = "Joe";
var hits = [];

for (var i = 0; i < text.length; i++); {
if (text[i] === "J") {
for (var j = i; j < (myName.length+ i); j++) {
hits.push(text[j]);
}
}
}
console.log(hits);


#2

Hey @frigolit! You cant just say text = "Something" like you did here:

But you have to make text a variable! :smile: Hope it works!


#3

var text or just text doesn't change anything for me, @amanuel2... :confused:
in the example in the first lesson they use only text and that one works perfectly