4/7 your "if" statement. Cannot figure out what is wrong


#1

/*jshint multistr:true */
var text = "crap, crap, crap, crap, crap, crap, crap, crap, crap \
crap, crap, Kevin, crap, crap, Kevin, crap, crap, crap, crap, crap \
crap, Kevin, crap, crap, crap, crap, crap, crap, crap, crap";
var myName = "Kevin";
var hits = [];

for (var i = 0; i < text.length; i ++) {
if (text [i] === "K") {
}
}


#2

for (var i = 0; i < text.length; i ++) {
if (text [i] === "K") {
}
"missing part"
}

After If statement , your code should do what? I believe you have forgotten the missing part in the question such as another for loop and hits.push("something something").


#3

I knew I should have added that part, but the instructions did not talk about it in lesson 4, they did not explain what a .push command would do or say to add a second for loop. I added them and I was able to progress but then I had already completed the whole of lesson 5/7 which talked about the second for loop and the .push. Very strange. Thank you nonetheless though. =)


#4

i still don't know how to do this


#5

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