Somebody help me with 6/7?


#1

/*jshint multistr:true */
var text="ac sdf fei fion sdifo afiona fdiow fiona feji f\
fjeifo fion feio fi";
var myName="fion";
var hits=[];
for (var i=0;i{
if(text[i]==='f')
{
for (var j=0;j<(i+myName.length);j++)
{
hits.push(text[j]);
}
}
}
if {hits.length===0)
{
console.log("Your name wasn't found!");
}
else
{
console.log(hits);
}

There was a problem with your syntax.

SyntaxError: Unexpected token {


#2


#3

Hi, j should be start with i, not 0.


#4

thanks, this is a problem, but still returns error:


#5

Please copy your actual code.


#6

/*jshint multistr:true */
var text="ac sdf fei fion sdifo afiona fdiow fiona feji f\
fjeifo fion feio fi";
var myName="fion";
var hits=[];
for (var i=0;i{
if(text[i]==='f')
{
for (var j=i;j<(i+myName.length);j++)
{
hits.push(text[j]);
}
}
}
if {hits.length===0)
{
console.log("Your name wasn't found!");
}
else
{
console.log(hits);
}

don't know why it's different


#7

fistly this line has error, I think you recognize it easily


#8

yes, but the original code is not like this. I don't know why.


#9

and this line is buggy, look at {


#11

problem solved, Thanks very much!