Weird result in "6. Log it"


/*jshint multistr:true */

var text = "Hi my name is Jacob, Jacob is my name";
var myName = "Jacob";
var hits = [];
for(var i = 0; i < text.length; i++) {
if (text[i] === 'J');{
for (var j = i; j < (myName.length + i); j++) {


if (hits.length === j) {
console.log("Your name wasn't found!"); }
else {

this is my code, and when i run it i do get to the next step, but in the console it shows random letters from my sentence, and it says a couple of times "undefined" i have really no clue to why it does this.
plz help :sweat_smile:


Hi try to remove the ";" after this if statement .........if (text[i] === 'J');


Thanks a lot dude! it worked :smiley: