Your first "for" loop


#1

var text = "Hey, how are you \
doing? My name is Emily.";/*jshint multistr:true */
var myName = "Emily";
var hits = [];
for (var i=0, i<=text.length, i+=1) {
console.log(text[i]);
}
getting a "SyntaxError: Unexpected token <=" message


Replace this line with your code.


#2

Keep it simple here,

Just write
i < text.length

And you should use semi colons instead of commas to divide the for loop. ;


#3

i've tried that too it didn't worked


#4

On the excercise you're on you do not require this line. :slight_smile:


#5

still it says syntaxerror


#6

Let me see what you have now :slight_smile:


#7

var text = "Hey, how are you \
doing? My name is Emily.";/*jshint multistr:true */
var myName = "Emily";
var hits = [];
for (var i=0, i}

this poped up on execution "SyntaxError: Unexpected token <"


#8

What have you done with your whole for loop I just said change the syntax to,

for (var i = 0; i < text.length; i++) {

}

Not remove it entirely. :smile:


#9

(var i=0, i}
need this ) not this }


#10

is it ok?? hmm?
var text = "Hey, how are you \
doing? My name is Emily.";/*jshint multistr:true */
var myName = "Emily";
var hits = [];
for (var i=0; i < text.length; i++) {
}


#11

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