Why is my debugger not counting iterations

Sometimes my debugger shows my for loop iteration counts up and others times it doesn’t.

Why is this? It makes it hard to exactly see whats going on when I can only see the counting up on certain occasions? Does this have to do with where you set the breakpoint?

That is not behavior I would expect. Do you have a code example? Yes, breakpoints could affect that, but I would expect it to be deterministic, not chaotic.

1 Like

Not really without doing a screencast tbh. For example right now I have a breakpoint added but nothing is getting counted up through each iteration of a for loop.

I could share the code if you think that could help but it may be hard to tell

Right. Share the code. If it is a lot, put it in a pen or a git repo and share that.

Okay, I am going to try the problem for one more night. If I cant get it I’ll post it tomorrow.

Thanks for the help Kevin!

1 Like

for(var i=0; i<10; i++){

Here is a simple for loop. I would expect it to be counting up on the screen as it goes through but nothing. Any idea?

EDIT: I am getting some adding and visuals now but still a bit different than before.

When I cut and paste that into the console of my debugger, it works just fine. There is no reason why it shouldn’t work. I have seen some odd asynchronous behaviors with logging reference types, but that wouldn’t apply here.

What is your browser? Have you tried other browsers? How are you getting to the debugger? What is the exact code that is giving you the issue? Is the code you are giving above giving you the issue?

1 Like

I think it was my browser and own computer. I got it to work after trial and error not sure what was happening before if I’m being completely honest.

It happens sometimes,

1 Like

Kevin, do you mind taking a peak at my other question I just posted?

The code is posted along with it.