Not doing something right


I need a little help. When I submit the code, it says "way to go!" , but the output is "[undefined]. So maybe I am close, but something is off. Here is my code:

/*jshint multistr:true */
var text = "My name is Jim. Jim is my name. My first name \
is not Jim.";

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

for (var i =0; i if (text[i] === "J"){
for (var j =i; j if (text[j] ==="i"){

hits.push (text[j]);

if (hits <0) {
console.log("Your name wasn't found!");

} else {


there are many errors causing problems. this one should work for you:

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


Thanks! I will review this a little more.