Tell us what’s happening:
This is a topic under debugging
“Use Caution When Reinitializing Variables Inside a Loop”
can open a few second and then gone, I couldn’t finish it.
How can I read and do code?
Your code so far
function myFunc() {
for (let i = 1; i != 4; i += 2) {
console.log("Still going!");
}
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36.
Challenge: Prevent Infinite Loops with a Valid Terminal Condition
According to the instructions: Fix the comparison operator in the terminal condition so the loop only runs for i less than or equal to 4
Right now, the result can NEVER be four because it starts from 1, right, so i !=4 will increment forever as will sequence, 1, 3, 5, 7,…
So you need to edit the i !=4 part of the condition, so that if i is less than or equal to 4 increment by two.
I dont mean the result.
I mean when I tried to open this page, it showed up a message “Something went wrong while displaying this webpage” and want me to press reload, I did it but still cant open it.
so I cant read the contents on this webpage.