Done Correctly... still don't get it!


Hey there,
So, this code is correct!!! YAY! But, I am still confused as to how I did it. It's like the pieces are all there, I just can't make sense of them. Can anyone explain how I did this to me. I understand declaring variables, I understand making arrays, I guess I get confused right after that! Help explain, if you can!!!

var text = "Hey there. I am Celeste. One of the most Celeste people that have ever been Celeste. Vote for me, Celeste!";
var myName = "Celeste" 
var hits = [] 
for(var i =0; i< text.length; i++) {
    if (text[i] === 'C') {
       for(var x = i; x <= (myName.length + i); x++) {
if ( hits.length ===0) {
    console.log("Your name wasn't found!");
} else {


Here a story using left & right index-finger


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