What's wrong


#1

https://www.codecademy.com/courses/javascript-beginner-en-XEDZA/0/5?curriculum_id=506324b3a7dffd00020bf661#


Replace this line with your code. 

/*jshint multistr:true */

text = " hi, how are you my name is Sidhant, what about you, what is\ you name, Sidhant. As you know my name is Sidhant only and not Sidhant"

var myName = "Sidhant"
var hits = []

for (var i=0; i < text.length; i++){
    if( text[i] === "S")
    {
        for (var j = i; i > i + myName.length;i++){
            hits.push(text[i])
            }
        }
        
    }


#2

HI this line

hits.push(text[i])

instead of text[i] you should put j in the text[j]

Then here

(var j = i; i > i + myName.length;i++)

this part

i > i + myName.length

first you should put < instead of > and the first i should be j like that

j < i + myName.length

then here

i++

change it to j++


#3

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