🐿️
-1

The console.log trick that finally clicked for my loop bug

Been fighting a loop for 3 days. Kept getting weird output. Read somewhere in the MDN docs to log the index variable, not just the whole array. Did that. Saw it jumping from 2 to 5. Turns out I had a typo in my increment line. One letter off. After I fixed it, everything ran perfect. Has anyone else had a spacing or naming typo that took forever to spot?
1 comments

Log in to join the discussion

Log In
1 Comment
foster.ruby
Yeah that's nothing, I once spent four hours debugging a missing semicolon that was hiding in plain sight.
8