Second for loop?


Here is my code, I don't know what's wrong with it, please help.

/*jshint multistr:true */
var text = "Hey fellas, I name is chris and I am 23 years old.";
var myName = "Chris";
var hits = [];

for (i = 0; i < text.length; i++) {

if (text[i] === "C") {

    for (var j = i; j < (myName.length + i); j++) {






why do you have text.[j]? what is the . doing there? you want to access the letter in text at index j, which simply would be: text[j]

oh, and on line 1 where you declare the text variable, in the text variable chris should be spelled with uppercase first letter


Oh great,

How can I make such an obtuse mistake?

Thanks a lot for your help though, the code works absolutely fine now.