Debugging - Prevent Infinite Loops with a Valid Terminal Condition

Tell us what’s happening:
when I press ‘run the test’ nothing happens. as far as I can see, my code shouldnt put out an infinite loop, as it will run for when i =1, and when i=3, and then will stop when i=5.

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 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0

Challenge: Debugging - Prevent Infinite Loops with a Valid Terminal Condition

Link to the challenge:

Your code is fine.
If you can’t pass the challenge however it could be because of the following…

There is an issue at the moment with the console not updating, but there is an easy workaround:

  1. Copy your code
  2. Refresh the page (CTRL+F5)
  3. Paste your code

This will refresh the console too. You may need to do this each time the console gets stuck, until you have correct code to pass the challenge.

This issue should be resolved soon!

1 Like

thank you, I appreciate that information and help.

I might be blind, could you show me the link where you found that announcement/info on the error? just so for the future I can check there if similar things pop up.

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