ZoeMitsuko (0)

Hello, I am new to coding and I'm​ trying to follow along with some videos.
This Repl is a simple javascript loop but I am confused because every time I run this simple code my result comes back "undefined", is there an error with my code? Am I trying to run it through the wrong language repl?
I don't understand why I'm not seeing my result in the console.

**if there are any errors with the way I am referencing my problems I would also take some advice on proper terms and grammar​,

Thank you!

You are viewing a single comment. View All
eankeen (997)


it looks like you swapped the 'greater than' and the 'less than' signs

i think you wrote

for( let i = 0; i > 10; i = i + 1){ 
console.log ( "This is i:", i)

however, you want to have i < 10. it seems you want to continue incrementing i as long as i is less than 10.

for( let i = 0; i < 10; i = i + 1){ 
console.log ( "This is i:", i)

hopefully that helped :)

ZoeMitsuko (0)

@eankeen thank you so much! That is such a silly simple mistake that I could have sworn I checked, but I suppose not because that fixed it right up!