I have no idea why am I getting the Oops


Oops, try again. It looks like your second 'for' loop isn't pushing values to the hits array. Make sure it's working properly and that myName's text appears somewhere in the text variable

var text = "this report examines alternative paths that a war between the United States and China might take, losses and other effects on both sides, preparations that the United States should make";
var myName = "China";
var hits = [];
for (i=0; i < text.lenght; i++) {
    if (text[i] === "C") {
        for(var j = i; j < myName.length + i; j++) {
if (hits.length === 0) {
	console.log("Your name wasn't found!");
} else {

I have no idea why am I getting the same Oops.. please if someone knows


This is a typo that is a deal breaker.


Thank you so much! I thought I am going crazy


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