5/10 Your second for loop help!


#1

/*jshint multistr:true */
var text = "Hey wassup it's Conner yep my name is Conner not Connor but Conner thats me and just to make sure its Conner thats the name.";
var myName = "Conner";
var hits = [];
for (var i = 0; i < text.length; i++){
if (text[i] === 'C') {
for (var c = i c < myName.length)
hits.push( text[c] );
}
}


#2

You want to console.log(hits) at the end, also in your second loop you missed seperating semicolons, and forgot to add c++ to remove the infinite loop.


#3

So like this?

var text = "Hey wassup it's Conner yep my name is Conner not Connor but Conner thats me and just to make sure its Conner thats the name.";
var myName = "Conner";
var hits = [];
for (var i = 0; i < text.length; i++) {
if (text[i] === 'C') {
for (var c = i; c < myName.length; c++)
hits.push( text[c] );
}
}
console.log(hits)