✅ foreach debugging: how do I see what iteration (the variable i in the superior for loop) I am in?

I am used to having an i variable in loops. My cow orkers are newbs all using foreach. When debugging, how should I know which iteration "i" that I'm in at a break so that I can inspect the thing being iterated thru and find the i'th row?
1 Reply
Jimmacle
Jimmacle4mo ago
add a counter in the loop yourself, because foreach doesn't keep track of iterations it's not a newb thing, it's the appropriate tool to use in many cases like with any sequence that isn't indexable or use the debugger and just inspect the actual object in that iteration if you don't actually need to know where it is in the collection
Want results from more Discord servers?
Add your server