Browser (safari and chrome) hangs(has been 2 days now) when clicked on "save&submit", lesson-introduction to 'for' LOOPS in JS, 5th topic


Replace this line with your code.


Please give us the FULL code you are using....


// Edit this for loop!

for (var i = 0; i < 35; i+5) {


Did you mean to write,

i += 5



Yes, Thank you
I found out the loop never ends if i do i+5, i tried i+=5 then and it worked. Thank you

One question though, in C and C++, i+5 would have worked, so is this a syntax difference in for loops between C++ and JS?


In JavaScript, i + 5 is an expression. It needs to be assigned. i += 5 is an assignment. It's not unique to JS, but expect other syntax differences between the two languages.


A post was split to a new topic: What is wrong with my code?


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