3. Your first "for" loop


#1


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


I am getting a syntax error message. It says this:
SyntaxError: Unexpected token <
Why is the < not being accepted?


var text = "Jade sihf sjbf Jade jnajbf Jade";
var myName = "Jade";
var hits = []
for (var i = 0, i < text.length; i++){
}

Never mind guys, I found the problem!


#2

Two things stand out:
1.) you are missing a semicolon after making your "hits" array

2.) you put a comma instead of a semicolon in your for loop after 'var i = 0'


#3

var text = "Jade sihf sjbf Jade jnajbf Jade";
var myName = "Jade";
var hits = [];
for (var i = 0: i < text.length; i++){
}
سئو سایت


#4

Thank you! This helped!


#5

Gah, such simple mistakes. Thank you!


#6

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