Question about for loops


#1

When I make this for loop it returns an extra line that just shows 8. Why is this?

I like star wars episode 1!
I like star wars episode 2!
I like star wars episode 3!
I like star wars episode 4!
I like star wars episode 5!
I like star wars episode 6!
I like star wars episode 7!
I like star wars episode 8!
8


// Write your loop below!

var episode = 1;


for (i = 0; i < 8; i++) {
    console.log("I like star wars episode " + episode + "!");
    episode++
}


#2

the codecademy console has the habit of echoing the last value, nothing to worry about


#3

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